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

Support CLI command to set environment variables

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • envinject-plugin
    • None

      The plugin would be more universal if it supported setting (hence passing them between steps) environment variables from step scripts using CLI interface ( https://wiki.jenkins-ci.org/display/JENKINS/Writing+CLI+commands ). Something like this:

      java -jar jenkins-cli.jar [-s JENKINS_URL] set-env-var -b BUILD_TAG -p VAR1=VAL1 -p VAR2=VAL2
      

          [JENKINS-36604] Support CLI command to set environment variables

          Victor Varvariuc created issue -
          Victor Varvariuc made changes -
          Component/s New: build-user-vars-plugin [ 17477 ]
          Component/s Original: _unsorted [ 19622 ]
          Victor Varvariuc made changes -
          Description Original: The plugin would be more universal if it supported setting (hence passing them between steps) environment variables from step scripts using CLI interface ( https://wiki.jenkins-ci.org/display/JENKINS/Writing+CLI+commands ). Something like this:
          {code}
          java -jar jenkins-cli.jar [-s JENKINS_URL] set-env-var -p KEY1=VAL1 -p KEY2=VAL2 -p KEY3=VAL3
          {code}
          New: The plugin would be more universal if it supported setting (hence passing them between steps) environment variables from step scripts using CLI interface ( https://wiki.jenkins-ci.org/display/JENKINS/Writing+CLI+commands ). Something like this:
          {code}
          java -jar jenkins-cli.jar [-s JENKINS_URL] set-env-var -b BUILD_ID -p VAR1=VAL1 -p VAR2=VAL2
          {code}
          Victor Varvariuc made changes -
          Description Original: The plugin would be more universal if it supported setting (hence passing them between steps) environment variables from step scripts using CLI interface ( https://wiki.jenkins-ci.org/display/JENKINS/Writing+CLI+commands ). Something like this:
          {code}
          java -jar jenkins-cli.jar [-s JENKINS_URL] set-env-var -b BUILD_ID -p VAR1=VAL1 -p VAR2=VAL2
          {code}
          New: The plugin would be more universal if it supported setting (hence passing them between steps) environment variables from step scripts using CLI interface ( https://wiki.jenkins-ci.org/display/JENKINS/Writing+CLI+commands ). Something like this:
          {code}
          java -jar jenkins-cli.jar [-s JENKINS_URL] set-env-var -b BUILD_TAG -p VAR1=VAL1 -p VAR2=VAL2
          {code}

          Oleg Nenashev added a comment -

          IMHO it's a wrong component. Build user vars just provides info about user who started the build. Maybe it's a case for EnvInject plugin or other such plugin.

          Oleg Nenashev added a comment - IMHO it's a wrong component. Build user vars just provides info about user who started the build. Maybe it's a case for EnvInject plugin or other such plugin.
          Victor Varvariuc made changes -
          Component/s New: envinject-plugin [ 15893 ]
          Component/s Original: build-user-vars-plugin [ 17477 ]

          Sorry, you are correct – fixed.

          Victor Varvariuc added a comment - Sorry, you are correct – fixed.
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 173325 ] New: JNJira + In-Review [ 185065 ]
          Oleg Nenashev made changes -
          Assignee Original: Oleg Nenashev [ oleg_nenashev ]

            Unassigned Unassigned
            warvariuc Victor Varvariuc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: