Skip to content

Instantly share code, notes, and snippets.

@zsiddiqi
Forked from noqcks/jenkins-plugins.md
Created November 5, 2019 02:26
Show Gist options
  • Select an option

  • Save zsiddiqi/a978516f1f95906b45fa5297d50e5e72 to your computer and use it in GitHub Desktop.

Select an option

Save zsiddiqi/a978516f1f95906b45fa5297d50e5e72 to your computer and use it in GitHub Desktop.

Revisions

  1. @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

  2. @noqcks noqcks revised this gist Jul 7, 2017. No changes.
  3. @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

  4. @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
  5. @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.
  6. @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

  7. @noqcks noqcks renamed this gist Jul 7, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. @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!