Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60943

Add JCasC support for remote retrieval of plugins

      I would like to suggest enhancing the JCasC mechanism in regards to plugins installation. Current procedure is quite intrusive and requires building a special Dockerfile.

      I suggest eliminating this cumbersome need, simply by adding another environment variable , similar to CASC_JENKINS_CONFIG (e.g. }}{{CASC_JENKINS_PLUGINS_CONFIG) which will hold a path or (more likely) a URL (e.g. to designated Git repository that holds the Jenkins configuration) in which the list of desired plugins will be retrieved in same format as today, and thus keep allowing running Jenkins container as today (with the addition of this new environment variable).{{}}

      I personally will wait for such a feature before reverting to JCasC (which is a great initiative).

      I very much hope this improvement will find its way into Jenkins in a short time.{{}}

          [JENKINS-60943] Add JCasC support for remote retrieval of plugins

          Ian Williams added a comment - - edited

          This is something of a catch-22. In order to leverage the JCasC plugin, to install plug-ins, you need the JCasC plugin! Have you reviewed the history behind Plugin Installation Manager CLI Tool / Library and Plugin Installation Manager Tool?

          Ian Williams added a comment - - edited This is something of a catch-22. In order to leverage the JCasC plugin, to install plug-ins, you need the JCasC plugin! Have you reviewed the history behind Plugin Installation Manager CLI Tool / Library and Plugin Installation Manager Tool ?

          Tiran Meltser added a comment -

          Hi,

          First - thanks for taking the time to comment

          Second - I think my intention was missed, so I'll refer to your points one by one:

          • "This is something nof a catch-22. In order to leverage the JCasC plugin, to install plug-ins, you need the JCasC plugin": from the documentation (https://plugins.jenkins.io/configuration-as-code) => "Those running Jenkins as a Docker container (and maybe also pre-installing plugins), do include Configuration as Code plugin.". For example, I'm running Jenkins via the jenkinsci/blueocean:latest image and I assume the JCasC plugin is already there (same as the blue ocean plugin) or can easily be populated in the image.
          • You mentioned "Plugin Installation Manager CLI Tool": I'm aiming higher than that, I don't wish to run by myself (via a custom dockerfile) any plugin manager, I would like the Jenkins image to have the logic internally to operate ANY plugin manager, while I'll supply the list of desired plugins.
          • Furthermore, I looked at the content of the blue ocean image and it turns out the last line in it is: "/bin/sh -c install-plugins.sh antisamy-markup-formatter matrix-auth blueocean:$BLUEOCEAN_VERSION", so if maybe another parameter would be added into this line (e.g. "-f $CASC_JENKINS_PLUGINS"), it will allow telling the install-plugins.sh script to load (also) plugins from the URL/Path in the *$CASC_JENKINS_PLUGINS* environment variable.

          I believe this ability isn't far from reach and would make the JCasC plugin (or rather concept) much more robust.

          Tiran Meltser added a comment - Hi, First - thanks for taking the time to comment Second - I think my intention was missed, so I'll refer to your points one by one: " This is something nof a catch-22. In order to leverage the JCasC plugin, to install plug-ins, you need the JCasC plugin ": from the documentation ( https://plugins.jenkins.io/configuration-as-code) => " Those running Jenkins as a Docker container (and maybe also pre-installing plugins ), do include Configuration as Code plugin. ". For example, I'm running Jenkins via the jenkinsci/blueocean:latest image and I assume the JCasC plugin is already there (same as the blue ocean plugin) or can easily be populated in the image. You mentioned " Plugin Installation Manager CLI Tool ": I'm aiming higher than that, I don't wish to run by myself (via a custom dockerfile) any plugin manager, I would like the Jenkins image to have the logic internally to operate ANY plugin manager, while I'll supply the list of desired plugins. Furthermore, I looked at the content of the blue ocean image and it turns out the last line in it is: " /bin/sh -c install-plugins.sh antisamy-markup-formatter matrix-auth blueocean:$BLUEOCEAN_VERSION ", so if maybe another parameter would be added into this line (e.g. " -f $ CASC_JENKINS_PLUGINS "), it will allow telling the install-plugins.sh script to load ( also ) plugins from the URL/Path in the * $CASC_JENKINS_PLUGINS* environment variable. I believe this ability isn't far from reach and would make the JCasC plugin (or rather concept) much more robust.

          Ian Williams added a comment -

          Hi, to respond in context,

          I am just another user also struggling w/plugin mgmt. Initially I was not aware of other's efforts at a different solution, hence shared the Plugin Installation Manager Tool reference. It is a modest improvement of install-plugins.sh

           

          We use standalone war in multiple instances in an Enterprise environment (100's users, 1,000's jobs), leverage customized install-plugins.sh from Docker source. Config Initially w/init.groovy.d, now added JCasC. Our jenkins.conf, jenkins.sh, plugins.txt, init.groovy / jcasc.yaml all checked into mgmt repo which we pull, then launch.

          JCasC made life much easier, but JEP-201 is still an (excellent) Work in Progress, with exciting enhancementsJEP-208 to come.

          Works well, but we yearn for more/better/simpler as do others, especially eg: if the plugins list does not match the config list or vice versa! I understand there are added issues using via Docker Image in a complex environment.

           

          I would love to see JCasC built into Core or extended as you suggest so that it accepted a plugins list as described. I expect there may be hurdles eg: JENKINS-51856, managing explicit vs dependent plugins,ver. compatibility, Dockerized or not, etc.

          Ideally for me, the (built-in) JCasC mechanism would just read, "with plugin (opt. +ver.), this configuration" then, if the plugin was missing, retrieve it, then configure.

          +1 for your issue; let's see where the maintainers go with it.

          Ian Williams added a comment - Hi, to respond in context, I am just another user also struggling w/plugin mgmt. Initially I was not aware of other's efforts at a different solution, hence shared the Plugin Installation Manager Tool reference. It is a modest improvement of install-plugins.sh   We use standalone war in multiple instances in an Enterprise environment (100's users, 1,000's jobs), leverage customized install-plugins.sh from Docker source. Config Initially w/init.groovy.d, now added JCasC. Our jenkins.conf, jenkins.sh, plugins.txt, init.groovy / jcasc.yaml all checked into mgmt repo which we pull, then launch. JCasC made life much easier, but JEP-201 is still an (excellent) Work in Progress, with exciting enhancements JEP-208 to come. Works well, but we yearn for more/better/simpler as do others, especially eg: if the plugins list does not match the config list or vice versa! I understand there are added issues using via Docker Image in a complex environment.   I would love to see JCasC built into Core or extended as you suggest so that it accepted a plugins list as described. I expect there may be hurdles eg: JENKINS-51856 , managing explicit vs dependent plugins,ver. compatibility, Dockerized or not, etc. Ideally for me, the (built-in) JCasC mechanism would just read, "with plugin (opt. +ver.), this configuration" then, if the plugin was missing, retrieve it, then configure. +1 for your issue; let's see where the maintainers go with it.

          Tiran Meltser added a comment -

          Thanks for adding your support, hope more will find this useful and vote accordingly and thus promote this ability to existence

          Tiran Meltser added a comment - Thanks for adding your support, hope more will find this useful and vote accordingly and thus promote this ability to existence

            Unassigned Unassigned
            tmeltser Tiran Meltser
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: