├── .gitignore ├── .mvn └── wrapper │ ├── MavenWrapperDownloader.java │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── CONTRIBUTION.md ├── Jenkinsfile ├── Jenkinsfile.release ├── LICENSE ├── NOTICE.md ├── README.md ├── docs ├── RELEASE.md └── images │ ├── configure-view-01.png │ ├── configure-view-02.png │ ├── create-view.png │ ├── dashboard-view.png │ ├── demo.gif │ ├── deploy-action.png │ └── release-history-view.png ├── mvnw ├── mvnw.cmd ├── pom.xml ├── release-settings.xml └── src └── main ├── java └── org │ └── jenkinsci │ └── plugins │ └── environmentdashboard │ ├── BuildAddUrl.java │ ├── Deployment.java │ └── DeploymentView.java ├── resources ├── index.jelly └── org │ └── jenkinsci │ └── plugins │ └── environmentdashboard │ └── DeploymentView │ ├── configure-entries.jelly │ ├── main.jelly │ └── newViewDetail.jelly └── webapp ├── css └── blink.css └── deploy.png /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | !**/src/main/** 4 | !**/src/test/** 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | 21 | ### NetBeans ### 22 | /nbproject/private/ 23 | /nbbuild/ 24 | /dist/ 25 | /nbdist/ 26 | /.nb-gradle/ 27 | build/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import java.net.*; 18 | import java.io.*; 19 | import java.nio.channels.*; 20 | import java.util.Properties; 21 | 22 | public class MavenWrapperDownloader { 23 | 24 | private static final String WRAPPER_VERSION = "0.5.6"; 25 | /** 26 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 27 | */ 28 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 29 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 30 | 31 | /** 32 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 33 | * use instead of the default one. 34 | */ 35 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 36 | ".mvn/wrapper/maven-wrapper.properties"; 37 | 38 | /** 39 | * Path where the maven-wrapper.jar will be saved to. 40 | */ 41 | private static final String MAVEN_WRAPPER_JAR_PATH = 42 | ".mvn/wrapper/maven-wrapper.jar"; 43 | 44 | /** 45 | * Name of the property which should be used to override the default download url for the wrapper. 46 | */ 47 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 48 | 49 | public static void main(String args[]) { 50 | System.out.println("- Downloader started"); 51 | File baseDirectory = new File(args[0]); 52 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 53 | 54 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 55 | // wrapperUrl parameter. 56 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 57 | String url = DEFAULT_DOWNLOAD_URL; 58 | if (mavenWrapperPropertyFile.exists()) { 59 | FileInputStream mavenWrapperPropertyFileInputStream = null; 60 | try { 61 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 62 | Properties mavenWrapperProperties = new Properties(); 63 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 64 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 65 | } catch (IOException e) { 66 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 67 | } finally { 68 | try { 69 | if (mavenWrapperPropertyFileInputStream != null) { 70 | mavenWrapperPropertyFileInputStream.close(); 71 | } 72 | } catch (IOException e) { 73 | // Ignore ... 74 | } 75 | } 76 | } 77 | System.out.println("- Downloading from: " + url); 78 | 79 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 80 | if (!outputFile.getParentFile().exists()) { 81 | if (!outputFile.getParentFile().mkdirs()) { 82 | System.out.println( 83 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 84 | } 85 | } 86 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 87 | try { 88 | downloadFileFromURL(url, outputFile); 89 | System.out.println("Done"); 90 | System.exit(0); 91 | } catch (Throwable e) { 92 | System.out.println("- Error downloading"); 93 | e.printStackTrace(); 94 | System.exit(1); 95 | } 96 | } 97 | 98 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 99 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 100 | String username = System.getenv("MVNW_USERNAME"); 101 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 102 | Authenticator.setDefault(new Authenticator() { 103 | @Override 104 | protected PasswordAuthentication getPasswordAuthentication() { 105 | return new PasswordAuthentication(username, password); 106 | } 107 | }); 108 | } 109 | URL website = new URL(urlString); 110 | ReadableByteChannel rbc; 111 | rbc = Channels.newChannel(website.openStream()); 112 | FileOutputStream fos = new FileOutputStream(destination); 113 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 114 | fos.close(); 115 | rbc.close(); 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/deploy-dashboard-plugin/c9cff434229e7369df53845fcb5c62c54fbd7584/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /CONTRIBUTION.md: -------------------------------------------------------------------------------- 1 | # Contribution 2 | Thank you for your interest in making [Deploy Dashboard Plugin](https://github.com/jenkinsci/deploy-dashboard-plugin) even better and more awesome. Your contributions are highly welcome. 3 | 4 | Plugin source code is hosted on [GitHub](https://github.com/jenkinsci/deploy-dashboard-plugin). New feature proposals and bug fix proposals should be submitted as [GitHub pull requests](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request). Your pull request will be evaluated by the [Jenkins job](https://jenkins.devops.namecheap.net/job/RND/job/jenkins-deploy-dashboard-plugin/). 5 | 6 | 7 | ## Development 8 | 9 | There is an official [Jenkins Plugin Development Guild](https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial) by Jenkins. All the details you will find there. 10 | 11 | In short, you have to be familiar with java (jdk 1.8 is required) and maven build tool. 12 | 13 | ```bash 14 | ./mvnw clean install 15 | ``` 16 | This command will build the plugin. The `hpi` file you can find in the `target` folder. 17 | 18 | ## Release (Only for Plugin's maintainers) 19 | 20 | Official documentation: [Performing a Plugin Release](https://jenkins.io/doc/developer/publishing/releasing/) 21 | 22 | There is `Jenkinsfile.release` file in the root directory which you can use as jenkins pipeline 23 | 24 | **For Namecheap employees only:** There is Jenkins job `https://{{NC_JENKINS_DOMAIN}}/job/RND/job/jenkins-deploy-dashboard-plugin/`. 25 | By running this job the new version (taken from [pom.xml](pom.xml) file) will be published. 26 | 27 | P.S. It usually takes time when the new version appears in the jenkins registry search. -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | buildPlugin() -------------------------------------------------------------------------------- /Jenkinsfile.release: -------------------------------------------------------------------------------- 1 | node() { 2 | stage('Checkout') { 3 | deleteDir() 4 | checkout scm 5 | } 6 | 7 | stage('Release') { 8 | withCredentials([usernamePassword(credentialsId: "user-nc-jenkins.io", usernameVariable: 'RELEASE_USERNAME', passwordVariable: 'RELEASE_PASSWORD')]) { 9 | sshagent(["ssh-nc-github"]) { 10 | sh "./mvnw --settings release-settings.xml -Drepo.login=${env.RELEASE_USERNAME} -Drepo.pwd=${env.RELEASE_PASSWORD} release:prepare release:perform" 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2020 Namecheap, Inc 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /NOTICE.md: -------------------------------------------------------------------------------- 1 | This product contains a modified version of Vipin's "environment-dashboard-plugin", 2 | which can be obtained at: 3 | * LICENSE: 4 | * [MIT](https://github.com/jenkinsci/environment-dashboard-plugin/blob/master/LICENSE.txt) 5 | * HOMEPAGE: 6 | * https://github.com/jenkinsci/environment-dashboard-plugin 7 | 8 | ------------------------------------------------------------------------------- 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jenkins Deploy Dashboard Plugin 2 | 3 | #### Overview 4 | 5 | This Jenkins plugin creates a custom view which can be used as a dashboard to display what code release versions have been deployed to what test and production environments (or devices). 6 | 7 | ![Demo](docs/images/demo.gif) 8 | 9 | 10 | ## Deployment View 11 | #### Add new view 12 | 13 | On the Jenkins main page or folder, click the + tab to start the new view wizard (If you 14 | do not see a +, it is likely you do not have permission to create a new view). 15 | On the "create new view" page, give your view a name and select the Deployment View 16 | type and click ok. 17 | 18 | ![Create view](docs/images/create-view.png) 19 | 20 | 21 | Select the list of jobs to include in the view. This is exactly the 22 | same process as the standard list view that comes with Jenkins. 23 | 24 | ![Configure view 1](docs/images/configure-view-01.png) 25 | 26 | Also a regular expression can be used to specify the jobs to include in 27 | the view. (e.g.: `.*` will select all the jobs in the folder) 28 | 29 | ![Create new view 2](docs/images/configure-view-02.png) 30 | 31 | #### How it looks like 32 | 33 | ![Dashboard](docs/images/dashboard-view.png) 34 | 35 | You can click on the specific environment and get the release history 36 | 37 | ![Dashboard History](docs/images/release-history-view.png) 38 | 39 | 40 | #### Pipeline | Add a new release to the environment 41 | ```groovy 42 | properties([parameters([ 43 | string(name: 'version', description: 'App version to deploy'), 44 | choice(name: 'env', choices: ['dev', 'prod'], description: 'Environment where the app should be deployed') 45 | ])]) 46 | 47 | node { 48 | stage("Deploy") { 49 | // Deploy app version ${params.version} to ${params.env} environment 50 | 51 | //add release information to dashboard 52 | addDeployToDashboard(env: params.env, buildNumber: params.version) 53 | } 54 | } 55 | ``` 56 | 57 | 58 | 59 | ## Add action button feature 60 | There is one more useful feature which this plugin can do. You can add the additional buttons to the build sidebar. 61 | This feature doesn't have any binding with Deploy Dashboard feature, it's just comfortable to use them together. 62 | 63 | #### Pipeline | Add button 64 | E.g.: We are building an app and add the the button which will link to deployment job 65 | ```groovy 66 | node { 67 | stage("Build") { 68 | String builtVersion = "v2.7.5" 69 | // Build app with ${builtVersion} version 70 | 71 | //Add buttons to the left sidebar 72 | buildAddUrl(title: 'Deploy to DEV', url: "/job/app-deploy/parambuild/?env=dev&version=${builtVersion}") 73 | buildAddUrl(title: 'Deploy to PROD', url: "/job/app-deploy/parambuild/?env=prod&version=${builtVersion}") 74 | } 75 | } 76 | ``` 77 | #### How it looks like 78 | 79 | ![Sidebar](docs/images/deploy-action.png) 80 | 81 | 82 | ## License 83 | 84 | This plugin is licensed under the Apache license 2.0, see [LICENSE](LICENSE). 85 | -------------------------------------------------------------------------------- /docs/RELEASE.md: -------------------------------------------------------------------------------- 1 | ## Release 2 | 3 | #### Manual Release 4 | Official documentation: [Performing a Plugin Release](https://jenkins.io/doc/developer/publishing/releasing/) 5 | 6 | #### Automatic Release 7 | You can set up pipeline job in Jenkins by [Jenkinsfile.release](Jenkinsfile.release) -------------------------------------------------------------------------------- /docs/images/configure-view-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/deploy-dashboard-plugin/c9cff434229e7369df53845fcb5c62c54fbd7584/docs/images/configure-view-01.png -------------------------------------------------------------------------------- /docs/images/configure-view-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/deploy-dashboard-plugin/c9cff434229e7369df53845fcb5c62c54fbd7584/docs/images/configure-view-02.png -------------------------------------------------------------------------------- /docs/images/create-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/deploy-dashboard-plugin/c9cff434229e7369df53845fcb5c62c54fbd7584/docs/images/create-view.png -------------------------------------------------------------------------------- /docs/images/dashboard-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/deploy-dashboard-plugin/c9cff434229e7369df53845fcb5c62c54fbd7584/docs/images/dashboard-view.png -------------------------------------------------------------------------------- /docs/images/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/deploy-dashboard-plugin/c9cff434229e7369df53845fcb5c62c54fbd7584/docs/images/demo.gif -------------------------------------------------------------------------------- /docs/images/deploy-action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/deploy-dashboard-plugin/c9cff434229e7369df53845fcb5c62c54fbd7584/docs/images/deploy-action.png -------------------------------------------------------------------------------- /docs/images/release-history-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/deploy-dashboard-plugin/c9cff434229e7369df53845fcb5c62c54fbd7584/docs/images/release-history-view.png -------------------------------------------------------------------------------- /mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | io.jenkins.plugins 5 | deploy-dashboard 6 | 0.1.1-SNAPSHOT 7 | hpi 8 | 9 | Deploy Dashboard Plugin by Namecheap 10 | 11 | Jenkins view dashboard that shows the information about which releases deployed to which environment. 12 | 13 | https://github.com/jenkinsci/deploy-dashboard-plugin 14 | 15 | 16 | 8 17 | true 18 | 19 | 20 | 21 | org.jenkins-ci.plugins 22 | plugin 23 | 3.57 24 | 25 | 26 | 27 | 28 | org.projectlombok 29 | lombok 30 | 1.18.12 31 | provided 32 | 33 | 34 | org.jenkins-ci.plugins.workflow 35 | workflow-multibranch 36 | 2.21 37 | 38 | 39 | 40 | 41 | 42 | The Apache Software License, Version 2.0 43 | http://www.apache.org/licenses/LICENSE-2.0.txt 44 | repo 45 | 46 | 47 | 48 | 49 | scm:git:ssh://github.com/jenkinsci/deploy-dashboard-plugin.git 50 | scm:git:ssh://git@github.com/jenkinsci/deploy-dashboard-plugin.git 51 | https://github.com/jenkinsci/deploy-dashboard-plugin 52 | HEAD 53 | 54 | 55 | 56 | 57 | vetal2409 58 | Vitalii Sydorenko 59 | vitaliy.sidorenko@namecheap.com 60 | 61 | 62 | StyleT 63 | Vlad Fedosov 64 | vladlen.f@namecheap.com 65 | 66 | 67 | vetal2409 68 | Yuriy Puchkov 69 | yuriy.puchkov@namecheap.com 70 | 71 | 72 | 73 | 74 | 75 | repo.jenkins-ci.org 76 | https://repo.jenkins-ci.org/public/ 77 | 78 | 79 | 80 | 81 | 82 | repo.jenkins-ci.org 83 | https://repo.jenkins-ci.org/public/ 84 | 85 | 86 | 87 | 88 | 89 | repo.jenkins-ci.org 90 | https://repo.jenkins-ci.org/releases 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /release-settings.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | repo.jenkins-ci.org 9 | ${repo.login} 10 | ${repo.pwd} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/org/jenkinsci/plugins/environmentdashboard/BuildAddUrl.java: -------------------------------------------------------------------------------- 1 | package org.jenkinsci.plugins.environmentdashboard; 2 | 3 | import hudson.Extension; 4 | import hudson.FilePath; 5 | import hudson.Launcher; 6 | import hudson.model.*; 7 | import hudson.tasks.*; 8 | import jenkins.tasks.SimpleBuildStep; 9 | import org.jenkinsci.Symbol; 10 | import org.kohsuke.stapler.DataBoundConstructor; 11 | 12 | import javax.annotation.Nonnull; 13 | import java.io.IOException; 14 | 15 | public class BuildAddUrl extends Builder implements SimpleBuildStep { 16 | 17 | private final String title; 18 | private final String url; 19 | 20 | @DataBoundConstructor 21 | public BuildAddUrl(String title, String url) { 22 | this.url = url; 23 | this.title = title; 24 | } 25 | 26 | public String getTitle() { 27 | return title; 28 | } 29 | 30 | public String getUrl() { 31 | return url; 32 | } 33 | 34 | @Override 35 | public BuildStepMonitor getRequiredMonitorService() { 36 | return BuildStepMonitor.NONE; 37 | } 38 | 39 | @Override 40 | public void perform( 41 | @Nonnull Run run, 42 | @Nonnull FilePath workspace, 43 | @Nonnull Launcher launcher, 44 | @Nonnull TaskListener listener 45 | ) throws InterruptedException, IOException { 46 | run.addAction(new BuildUrlAction(title, url)); 47 | } 48 | 49 | @Extension 50 | @Symbol("buildAddUrl") 51 | public static class DescriptorImpl extends BuildStepDescriptor { 52 | @Override 53 | @Nonnull 54 | public String getDisplayName() { 55 | return "Build Add Url"; 56 | } 57 | 58 | @Override 59 | public boolean isApplicable(Class t) { 60 | return true; 61 | } 62 | } 63 | 64 | public static class BuildUrlAction implements Action { 65 | private final String title; 66 | private final String url; 67 | 68 | BuildUrlAction(String title, String url) { 69 | this.title = title; 70 | this.url = url; 71 | } 72 | 73 | @Override 74 | public String getIconFileName() { 75 | return String.format("/plugin/%s/deploy.png", getClass().getPackage().getImplementationTitle()); 76 | } 77 | 78 | @Override 79 | public String getDisplayName() { 80 | return title; 81 | } 82 | 83 | @Override 84 | public String getUrlName() { 85 | return url; 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/org/jenkinsci/plugins/environmentdashboard/Deployment.java: -------------------------------------------------------------------------------- 1 | package org.jenkinsci.plugins.environmentdashboard; 2 | 3 | import hudson.Extension; 4 | import hudson.FilePath; 5 | import hudson.Launcher; 6 | import hudson.model.*; 7 | import hudson.tasks.BuildStepDescriptor; 8 | import hudson.tasks.Builder; 9 | import jenkins.model.RunAction2; 10 | import jenkins.tasks.SimpleBuildStep; 11 | import org.jenkinsci.Symbol; 12 | import org.kohsuke.stapler.DataBoundConstructor; 13 | 14 | import javax.annotation.Nonnull; 15 | import java.io.IOException; 16 | 17 | public class Deployment extends Builder implements SimpleBuildStep { 18 | 19 | private final String env; 20 | private final String buildNumber; 21 | 22 | @DataBoundConstructor 23 | public Deployment(String env, String buildNumber) { 24 | this.env = env; 25 | this.buildNumber = buildNumber; 26 | } 27 | 28 | public String getEnv() { 29 | return env; 30 | } 31 | 32 | public String getBuildNumber() { 33 | return buildNumber; 34 | } 35 | 36 | @Override 37 | public void perform( 38 | @Nonnull Run run, 39 | @Nonnull FilePath workspace, 40 | @Nonnull Launcher launcher, 41 | @Nonnull TaskListener listener 42 | ) throws InterruptedException, IOException { 43 | run.addAction(new DeploymentAction( 44 | env, 45 | buildNumber 46 | )); 47 | } 48 | 49 | @Extension 50 | @Symbol("addDeployToDashboard") 51 | public static class DescriptorImpl extends BuildStepDescriptor { 52 | @Override 53 | @Nonnull 54 | public String getDisplayName() { 55 | return "Deployment"; 56 | } 57 | 58 | @Override 59 | public boolean isApplicable(Class t) { 60 | return true; 61 | } 62 | } 63 | 64 | public static final class DeploymentAction implements RunAction2 { 65 | 66 | private Run run; 67 | private String env; 68 | private String buildNumber; 69 | 70 | public DeploymentAction(String env, String buildNumber) { 71 | this.env = env; 72 | this.buildNumber = buildNumber; 73 | } 74 | 75 | @Override 76 | public String getIconFileName() { 77 | return null; 78 | } 79 | 80 | @Override 81 | public String getDisplayName() { 82 | return String.format( 83 | "Deployment %s to %s", 84 | buildNumber, 85 | env 86 | ); 87 | } 88 | 89 | @Override 90 | public String getUrlName() { 91 | return null; 92 | } 93 | 94 | public String getBuildNumber() { 95 | return buildNumber; 96 | } 97 | 98 | public String getEnv() { 99 | return env; 100 | } 101 | 102 | public Run getRun() { 103 | return run; 104 | } 105 | 106 | @Override 107 | public void onLoad(Run r) { 108 | this.run = r; 109 | } 110 | 111 | @Override 112 | public void onAttached(Run r) { 113 | this.run = r; 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/main/java/org/jenkinsci/plugins/environmentdashboard/DeploymentView.java: -------------------------------------------------------------------------------- 1 | package org.jenkinsci.plugins.environmentdashboard; 2 | 3 | import hudson.Extension; 4 | import hudson.Util; 5 | import hudson.model.Job; 6 | import hudson.model.ListView; 7 | import hudson.model.TopLevelItem; 8 | import hudson.model.ViewDescriptor; 9 | import hudson.util.FormValidation; 10 | import lombok.Getter; 11 | import lombok.RequiredArgsConstructor; 12 | import net.sf.json.JSONObject; 13 | import org.jenkinsci.plugins.environmentdashboard.Deployment.DeploymentAction; 14 | import org.jenkinsci.plugins.workflow.job.WorkflowJob; 15 | import org.jenkinsci.plugins.workflow.job.WorkflowRun; 16 | import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject; 17 | import org.kohsuke.stapler.DataBoundConstructor; 18 | import org.kohsuke.stapler.QueryParameter; 19 | import org.kohsuke.stapler.StaplerRequest; 20 | 21 | import javax.annotation.Nonnull; 22 | import java.util.Collection; 23 | import java.util.Collections; 24 | import java.util.List; 25 | import java.util.Objects; 26 | import java.util.regex.Pattern; 27 | import java.util.regex.PatternSyntaxException; 28 | import java.util.stream.Collectors; 29 | 30 | public class DeploymentView extends ListView { 31 | @DataBoundConstructor 32 | public DeploymentView(String name) { 33 | super(name); 34 | } 35 | 36 | private List getEnvs(TopLevelItem item) { 37 | List runs = Collections.emptyList(); 38 | if (item instanceof WorkflowMultiBranchProject) { 39 | runs = ((WorkflowMultiBranchProject) item) 40 | .getItems() 41 | .stream() 42 | .map(Job::getBuilds) 43 | .flatMap(Collection::stream) 44 | .collect(Collectors.toList()); 45 | } else if (item instanceof WorkflowJob) { 46 | runs = ((WorkflowJob) item).getBuilds(); 47 | } 48 | 49 | return runs 50 | .stream() 51 | .map(run -> run.getAction(DeploymentAction.class)) 52 | .filter(Objects::nonNull) 53 | .collect(Collectors.groupingBy(DeploymentAction::getEnv)) 54 | .entrySet() 55 | .stream() 56 | .map(e -> new Unit.Environment(e.getKey(), e.getValue())) 57 | .collect(Collectors.toList()); 58 | } 59 | 60 | public List getUnits(List items) { 61 | return items 62 | .stream() 63 | .map(item -> new Unit(item, getEnvs(item))) 64 | .filter(unit -> !unit.getEnvironments().isEmpty()) 65 | .collect(Collectors.toList()); 66 | } 67 | 68 | @Getter 69 | @RequiredArgsConstructor 70 | public static class Unit { 71 | private final TopLevelItem job; 72 | private final List environments; 73 | 74 | @Getter 75 | @RequiredArgsConstructor 76 | public static class Environment { 77 | private final String name; 78 | private final List actions; 79 | 80 | public DeploymentAction getCurrentAction() { 81 | return actions.get(0); 82 | } 83 | } 84 | } 85 | 86 | @Extension 87 | public static class DeploymentViewDescriptor extends ViewDescriptor { 88 | public DeploymentViewDescriptor() { 89 | super(DeploymentView.class); 90 | load(); 91 | } 92 | 93 | @Override 94 | @Nonnull 95 | public String getDisplayName() { 96 | return "Deployment View"; 97 | } 98 | 99 | // Copy-n-paste from ListView$Descriptor as sadly we cannot inherit from that class 100 | public FormValidation doCheckIncludeRegex(@QueryParameter String value) { 101 | String v = Util.fixEmpty(value); 102 | if (v != null) { 103 | try { 104 | Pattern.compile(v); 105 | } catch (PatternSyntaxException pse) { 106 | return FormValidation.error(pse.getMessage()); 107 | } 108 | } 109 | return FormValidation.ok(); 110 | } 111 | 112 | @Override 113 | public boolean configure(StaplerRequest req, JSONObject json) throws FormException { 114 | save(); 115 | 116 | return true; 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/main/resources/index.jelly: -------------------------------------------------------------------------------- 1 | 2 |
3 | This plugin is used to generate the Deploy Dashboards 4 |
5 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkinsci/plugins/environmentdashboard/DeploymentView/configure-entries.jelly: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 |
36 |
37 |
38 |
39 |
40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
54 |
-------------------------------------------------------------------------------- /src/main/resources/org/jenkinsci/plugins/environmentdashboard/DeploymentView/main.jelly: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 28 | 33 | 38 | 43 | 48 | 49 | 50 | 51 | 52 | 57 | 62 | 67 | 71 | 74 | 75 | 76 | 77 | 78 |
24 | 25 | Job 26 | 27 | 29 | 30 | Environment 31 | 32 | 34 | 35 | Release 36 | 37 | 39 | 40 | Result 41 | 42 | 44 | 45 | Completed 46 | 47 |
53 | 54 | ${unit.getJob().name} 55 | 56 | 58 | 59 | ${environment.getName()} 60 | 61 | 63 | 64 | ${environment.getCurrentAction().buildNumber} 65 | 66 | 68 | 70 | 72 | ${environment.getCurrentAction().run.timestampString} 73 |
79 |
80 | 81 | 82 | 83 | 133 | 134 | 135 | 136 | 137 | 159 |
160 |
161 |
-------------------------------------------------------------------------------- /src/main/resources/org/jenkinsci/plugins/environmentdashboard/DeploymentView/newViewDetail.jelly: -------------------------------------------------------------------------------- 1 | 2 |
3 | Shows your deployments to different environments. 4 |
-------------------------------------------------------------------------------- /src/main/webapp/css/blink.css: -------------------------------------------------------------------------------- 1 | /* The Modal (background) */ 2 | .modal { 3 | display: none; /* Hidden by default */ 4 | position: fixed; /* Stay in place */ 5 | padding-top: 100px; /* Location of the box */ 6 | left: 0; 7 | top: 0; 8 | width: 100%; /* Full width */ 9 | height: 100%; /* Full height */ 10 | overflow: auto; /* Enable scroll if needed */ 11 | background-color: rgb(0, 0, 0); /* Fallback color */ 12 | background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */ 13 | z-index: 999; 14 | } 15 | 16 | /* Modal Content */ 17 | .modal-content { 18 | position: relative; 19 | background-color: #fefefe; 20 | margin: auto; 21 | padding: 0; 22 | border: 1px solid #888; 23 | width: 80%; 24 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 25 | -webkit-animation-name: animatetop; 26 | -webkit-animation-duration: 0.4s; 27 | animation-name: animatetop; 28 | animation-duration: 0.4s 29 | } 30 | 31 | /* Add Animation */ 32 | @-webkit-keyframes animatetop { 33 | from { 34 | top: -300px; 35 | opacity: 0 36 | } 37 | to { 38 | top: 0; 39 | opacity: 1 40 | } 41 | } 42 | 43 | @keyframes animatetop { 44 | from { 45 | top: -300px; 46 | opacity: 0 47 | } 48 | to { 49 | top: 0; 50 | opacity: 1 51 | } 52 | } 53 | 54 | /* The Close Button */ 55 | .close { 56 | color: white; 57 | float: right; 58 | font-size: 28px; 59 | font-weight: bold; 60 | } 61 | 62 | .close:before { 63 | content: 'x'; 64 | } 65 | 66 | .close:hover, 67 | .close:focus { 68 | color: #727272; 69 | text-decoration: none; 70 | cursor: pointer; 71 | } 72 | 73 | .modal-header { 74 | padding: 2px 16px; 75 | background-color: #000000; 76 | color: white; 77 | } 78 | 79 | .modal-body { 80 | padding: 1em; 81 | } 82 | 83 | .modal-body tbody td:first-child { 84 | padding: 1em; 85 | } 86 | 87 | .modal-body tbody tr:first-child th:first-child { 88 | padding: .7em !important; 89 | } -------------------------------------------------------------------------------- /src/main/webapp/deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/deploy-dashboard-plugin/c9cff434229e7369df53845fcb5c62c54fbd7584/src/main/webapp/deploy.png --------------------------------------------------------------------------------