-
-
Save DozenCoder/b7c7da9c0bd23f8c2c6b0b026a18508b to your computer and use it in GitHub Desktop.
Revisions
-
DozenCoder revised this gist
Aug 3, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ I need a way to get a list of plugins so that I can use them with [docker jenkins](https://hub.docker.com/_/jenkins/) in the format `<plugin>:<version>` ## 1. get the jenkins cli. -
DozenCoder revised this gist
Aug 3, 2020 . 1 changed file with 11 additions and 19 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,25 +29,17 @@ java -jar jenkins-cli.jar -s http://localhost:8080 -auth admin:<password> groovy The output looks like this ``` trilead-api:1.0.6 gradle:1.36 cloudbees-folder:6.12 workflow-basic-steps:2.20 antisamy-markup-formatter:2.0 branch-api:2.5.6 jdk-tool:1.4 structs:1.20 handlebars:1.1.1 workflow-step-api:2.22 token-macro:2.12 ``` Enjoy! -
DozenCoder revised this gist
Aug 3, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,15 +15,15 @@ We need to create a groovy script to parse the information we receive from the j ``` def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins() plugins.each {println "${it.getShortName()}:${it.getVersion()}"} ``` ## 3. call the Jenkins API. Use jenkins-cli.jar to call the jenkins server where it is located (localhost:8080) in this case with the username and password you use for login and then output the results to plugins.txt ``` java -jar jenkins-cli.jar -s http://localhost:8080 -auth admin:<password> groovy = < plugins.groovy > plugins.txt ``` The output looks like this -
noqcks revised this gist
Jul 7, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins() plugins.each {println "${it.getShortName()}: ${it.getVersion()}"} ``` ## 3. call the Jenkins API. Use jenkins-cli.jar to call the jenkins server where it is located (localhost:8080) in this case with the username and password you use for login and then output the results to plugins.txt -
noqcks revised this gist
Jul 7, 2017 . No changes.There are no files selected for viewing
-
noqcks revised this gist
Jul 7, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,15 @@ I need a way to get a list of plugins so that I can use them with [docker jenkins](https://hub.docker.com/_/jenkins/) in the format `<plugin>: <version>` ## 1. get the jenkins cli. The jenkins CLI will allow us to interact with our jenkins server from the command line. We can get it with a simple curl call. ``` curl 'localhost:8080/jnlpJars/jenkins-cli.jar' > jenkins-cli.jar ``` ## 2. create a groovy script. We need to create a groovy script to parse the information we receive from the jenkins API. This will output each plugin with its version. Save the following as `plugins.groovy`. @@ -18,7 +18,7 @@ def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins() plugins.each {println "${it.getShortName()}: ${it.getVersion()}"} ``` ## 3. call the Jenkins API Use jenkins-cli.jar to call the jenkins server where it is located (localhost:8080) in this case with the username and password you use for login and then output the results to plugins.txt -
noqcks revised this gist
Jul 7, 2017 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,17 @@ I need a way to get a list of plugins so that I can use them with [docker jenkins](https://hub.docker.com/_/jenkins/) in the format `<plugin>: <version>` 1. get the jenkins cli. The jenkins CLI will allow us to interact with our jenkins server from the command line. We can get it with a simple curl call. ``` curl 'localhost:8080/jnlpJars/jenkins-cli.jar' > jenkins-cli.jar ``` 2. create a groovy script. We need to create a groovy script to parse the information we receive from the jenkins API. This will output each plugin with its version. Save the following as `plugins.groovy`. ``` def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins() @@ -20,7 +20,7 @@ plugins.each {println "${it.getShortName()}: ${it.getVersion()}"} 3. call the Jenkins API Use jenkins-cli.jar to call the jenkins server where it is located (localhost:8080) in this case with the username and password you use for login and then output the results to plugins.txt ``` java -jar jenkins-cli.jar -s http://localhost:8080 groovy --username "admin" --password "admin" = < plugins.groovy > plugins.txt -
noqcks revised this gist
Jul 7, 2017 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ I need a way to get a list of plugins so that I can use them with [docker jenkins](https://hub.docker.com/_/jenkins/) in the format `<plugin>: <version>`. --- 1. get the jenkins cli The jenkins CLI will allow us to interact with our jenkins server from the command line. We can get it with a simple curl call. -
noqcks revised this gist
Jul 7, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ I need a way to get a list of plugins so that I can use them with [docker jenkins](https://hub.docker.com/_/jenkins/) in the format `<plugin>: <version>`. 1. get the jenkins cli The jenkins CLI will allow us to interact with our jenkins server from the command line. We can get it with a simple curl call. @@ -18,7 +19,7 @@ def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins() plugins.each {println "${it.getShortName()}: ${it.getVersion()}"} ``` 3. call the Jenkins API Call the jenkins server where it is located (localhost:8080) in this case with the username and password you use for login and then output the results to plugins.txt -
noqcks renamed this gist
Jul 7, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
noqcks created this gist
Jul 7, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ I need a way to get a list of plugins so that I can use them with [docker jenkins](https://hub.docker.com/_/jenkins/) in the format `<plugin>: <version>`. 1. get the jenkins cli The jenkins CLI will allow us to interact with our jenkins server from the command line. We can get it with a simple curl call. ``` curl 'localhost:8080/jnlpJars/jenkins-cli.jar' > jenkins-cli.jar ``` 2. create groovy script We need to create a groovy script to parse the information we receive from the jenkins API. This will output each plugin with its version. ``` def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins() plugins.each {println "${it.getShortName()}: ${it.getVersion()}"} ``` 2. call the Jenkins API Call the jenkins server where it is located (localhost:8080) in this case with the username and password you use for login and then output the results to plugins.txt ``` java -jar jenkins-cli.jar -s http://localhost:8080 groovy --username "admin" --password "admin" = < plugins.groovy > plugins.txt ``` The output looks like this ``` ace-editor: 1.1 ant: 1.5 antisamy-markup-formatter: 1.5 authentication-tokens: 1.3 blueocean-autofavorite: 1.0.0 blueocean-commons: 1.1.4 blueocean-config: 1.1.4 blueocean-dashboard: 1.1.4 blueocean-display-url: 2.0 blueocean-events: 1.1.4 blueocean-git-pipeline: 1.1.4 blueocean-github-pipeline: 1.1.4 blueocean-i18n: 1.1.4 blueocean-jwt: 1.1.4 blueocean-personalization: 1.1.4 blueocean-pipeline-api-impl: 1.1.4 blueocean-pipeline-editor: 0.2.0 blueocean-pipeline-scm-api: 1.1.4 blueocean-rest-impl: 1.1.4 ``` Enjoy!