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

Can't add "environment inject" pre scm build step.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Run buildstep before SCM runs
      Add build step
      Inject environment variables
      Save
      BOOM!

        Attachments

          Activity

          Hide
          gbois Gregory Boissinot added a comment -

          It seems you are using the pre-scm-buildstep plugin.
          Could you confirm me?
          If yes, do you really need to usse this plugin?
          The envinject plugin makes it possible to execute a script before the scm checkout.

          Then, could you give me your Jenkins core version and the versions of your plugins?

          Show
          gbois Gregory Boissinot added a comment - It seems you are using the pre-scm-buildstep plugin. Could you confirm me? If yes, do you really need to usse this plugin? The envinject plugin makes it possible to execute a script before the scm checkout. Then, could you give me your Jenkins core version and the versions of your plugins?
          Hide
          gbois Gregory Boissinot added a comment -

          I tested with Jenkins 1.410 (required by the EnvInject plugin) and the pre-scm-buildstep.
          All is fine.
          Waiting for your inputs.

          Show
          gbois Gregory Boissinot added a comment - I tested with Jenkins 1.410 (required by the EnvInject plugin) and the pre-scm-buildstep. All is fine. Waiting for your inputs.
          Hide
          gorillacoder giuliano carlini added a comment -

          Jenkins 1.434

          I am using the pre-scm-buildstup plugin. I need to first run a script to build a value that will be assigned to an env var. I was going to do this by running the script and creating a properties file. But envinject first does property bindings and then runs the scripts. pre-scm lets me create two build steps, the first a script, then envinject.

          If I might make a suggestion. It might be better that if pre-scm-buildstep is present, to make envinject available only through it. That is, add "Prepare an environment for the job", only if pre-scm-buildstep is not present. Ditto "Inject environment variables to the build process". Just make it a build step. In which case you can get rid of the script bits, because both pre-scm and buildstep already have script steps. And rather than two parts to the envinject u/i, one for properties in a file and the second a textbox for them to be given in the u/i, you could make those separate steps. Would make the config page cleaner.

          Also, "Prepare an environment for the job does not sound anything like "Inject environment variables to the build process". If you keep them, it would be nice if they sounded related.

          Show
          gorillacoder giuliano carlini added a comment - Jenkins 1.434 I am using the pre-scm-buildstup plugin. I need to first run a script to build a value that will be assigned to an env var. I was going to do this by running the script and creating a properties file. But envinject first does property bindings and then runs the scripts. pre-scm lets me create two build steps, the first a script, then envinject. If I might make a suggestion. It might be better that if pre-scm-buildstep is present, to make envinject available only through it. That is, add "Prepare an environment for the job", only if pre-scm-buildstep is not present. Ditto "Inject environment variables to the build process". Just make it a build step. In which case you can get rid of the script bits, because both pre-scm and buildstep already have script steps. And rather than two parts to the envinject u/i, one for properties in a file and the second a textbox for them to be given in the u/i, you could make those separate steps. Would make the config page cleaner. Also, "Prepare an environment for the job does not sound anything like "Inject environment variables to the build process". If you keep them, it would be nice if they sounded related.
          Hide
          gbois Gregory Boissinot added a comment -

          The envinject plugin was developed before the pre-scm-plugin and it doesn't aware of this plugin at the moment.
          The aim of the envinject plugin is prepare an environment and inject properties as build steps.
          'Prepare an environment' option makes it possible to inject variables and to execute a script to create the running environment such as create folders, ....
          For your need, this option is not useful. And all is OK because through the pre scm build step plugin, you are able to use 'Inject variables as build step'.

          Therefore, where is the bug?

          Show
          gbois Gregory Boissinot added a comment - The envinject plugin was developed before the pre-scm-plugin and it doesn't aware of this plugin at the moment. The aim of the envinject plugin is prepare an environment and inject properties as build steps. 'Prepare an environment' option makes it possible to inject variables and to execute a script to create the running environment such as create folders, .... For your need, this option is not useful. And all is OK because through the pre scm build step plugin, you are able to use 'Inject variables as build step'. Therefore, where is the bug?
          Hide
          gorillacoder giuliano carlini added a comment -

          The bug is that on 1.434, when I add an envinject step with the pre-scm-buildstep plugin, when I save, an exception is thrown. I'm at home now. When I get to work I'll provide the error page's contents.

          The repro steps are:
          Open a brand spanking new project
          Add a pre-scm-buildstep for env inject
          Save

          Show
          gorillacoder giuliano carlini added a comment - The bug is that on 1.434, when I add an envinject step with the pre-scm-buildstep plugin, when I save, an exception is thrown. I'm at home now. When I get to work I'll provide the error page's contents. The repro steps are: Open a brand spanking new project Add a pre-scm-buildstep for env inject Save
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuilder.java
          http://jenkins-ci.org/commit/envinject-plugin/f04d5d3d6113f8a6cb4f319920481dd1e3edbe29
          Log:
          Fixed JENKINS-11439

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuilder.java http://jenkins-ci.org/commit/envinject-plugin/f04d5d3d6113f8a6cb4f319920481dd1e3edbe29 Log: Fixed JENKINS-11439
          Hide
          gbois Gregory Boissinot added a comment -

          Ok, right.
          I fixed the bug.
          Thanks

          Show
          gbois Gregory Boissinot added a comment - Ok, right. I fixed the bug. Thanks
          Hide
          gorillacoder giuliano carlini added a comment -

          Awesome. Thanks!

          Show
          gorillacoder giuliano carlini added a comment - Awesome. Thanks!

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              gorillacoder giuliano carlini
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: