Skip to content

Instantly share code, notes, and snippets.

@DozenCoder
Forked from noqcks/jenkins-plugins.md
Last active August 3, 2020 04:42
Show Gist options
  • Save DozenCoder/b7c7da9c0bd23f8c2c6b0b026a18508b to your computer and use it in GitHub Desktop.
Save DozenCoder/b7c7da9c0bd23f8c2c6b0b026a18508b to your computer and use it in GitHub Desktop.

Revisions

  1. DozenCoder revised this gist Aug 3, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion jenkins-plugins.md
    Original 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>`
    in the format `<plugin>:<version>`

    ## 1. get the jenkins cli.

  2. DozenCoder revised this gist Aug 3, 2020. 1 changed file with 11 additions and 19 deletions.
    30 changes: 11 additions & 19 deletions jenkins-plugins.md
    Original 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

    ```
    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
    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!
  3. DozenCoder revised this gist Aug 3, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions jenkins-plugins.md
    Original 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()}"}
    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
    java -jar jenkins-cli.jar -s http://localhost:8080 -auth admin:<password> groovy = < plugins.groovy > plugins.txt
    ```

    The output looks like this
  4. @noqcks noqcks revised this gist Jul 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion jenkins-plugins.md
    Original 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
    ## 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

  5. @noqcks noqcks revised this gist Jul 7, 2017. No changes.
  6. @noqcks noqcks revised this gist Jul 7, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions jenkins-plugins.md
    Original 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.
    ## 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.
    ## 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
    ## 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

  7. @noqcks noqcks revised this gist Jul 7, 2017. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions jenkins-plugins.md
    Original 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
    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
    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.
    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

    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
    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
  8. @noqcks noqcks revised this gist Jul 7, 2017. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions jenkins-plugins.md
    Original 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.
  9. @noqcks noqcks revised this gist Jul 7, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion jenkins-plugins.md
    Original 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()}"}
    ```

    2. call the Jenkins API
    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

  10. @noqcks noqcks renamed this gist Jul 7, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  11. @noqcks noqcks created this gist Jul 7, 2017.
    53 changes: 53 additions & 0 deletions jenkins-plugins.txt
    Original 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!