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

User Hudson Global environment variables not set with m2-extra-steps for Shell extra step

    XMLWordPrintable

Details

    Description

      I have a specific Global environment variables set in Hudson/Manage
      Hudson/Configure System/Global Properties, called TEST.

      When I use a 'Free style' Hudson job with a Shell script, I can use ${TEST} in my
      shell command.

      When it is defined in a m2 extra step, Shell script does not see the TEST variable
      (I did a set command on both case), whereas for ANT m2 extra step, ANT script see
      it.

      Attachments

        Issue Links

          Activity

            abrugger abrugger created issue -
            abrugger abrugger added a comment -

            Actually it seems it's for every steps, even ANT/Groovy steps.

            abrugger abrugger added a comment - Actually it seems it's for every steps, even ANT/Groovy steps.

            Hello,

            Can confirm this with Hudson 1.332. If you set a property in Manage Hudson >
            Configure system > Global properties > Environment variables, its value is not
            accessible to either master or slaves, when trying to:
            a) pass it to a Maven build (invoke top level Maven goals) - tried all sorts of
            syntaxes: $Variable, ${Variable}, ...
            b) pass it to an Ant build (invoke Ant targets) - same

            This is a major nuisance.

            ccaraivan Costin Caraivan added a comment - Hello, Can confirm this with Hudson 1.332. If you set a property in Manage Hudson > Configure system > Global properties > Environment variables, its value is not accessible to either master or slaves, when trying to: a) pass it to a Maven build (invoke top level Maven goals) - tried all sorts of syntaxes: $Variable, ${Variable}, ... b) pass it to an Ant build (invoke Ant targets) - same This is a major nuisance.
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Link This issue is duplicated by JENKINS-4851 [ JENKINS-4851 ]

            Code changed in hudson
            User: : abayer
            Path:
            trunk/hudson/plugins/m2-extra-steps/src/main/java/hudson/plugins/m2extrasteps/M2ExtraStepsAction.java
            trunk/hudson/plugins/m2-extra-steps/src/main/java/hudson/plugins/m2extrasteps/M2ExtraStepsWrapper.java
            http://fisheye4.cenqua.com/changelog/hudson/?cs=24779
            Log:
            [FIXED JENKINS-4701] Forcing through population of node properties as environment variables through an EnvironmentContributingAction

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/plugins/m2-extra-steps/src/main/java/hudson/plugins/m2extrasteps/M2ExtraStepsAction.java trunk/hudson/plugins/m2-extra-steps/src/main/java/hudson/plugins/m2extrasteps/M2ExtraStepsWrapper.java http://fisheye4.cenqua.com/changelog/hudson/?cs=24779 Log: [FIXED JENKINS-4701] Forcing through population of node properties as environment variables through an EnvironmentContributingAction
            scm_issue_link SCM/JIRA link daemon made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            ilot ilot added a comment -

            I have the same issue on 1.384.
            when I define a global property (name=TEST and value=MYVALUE) in "Hudson/Manage
            Hudson/Configure System/Global Properties" and I use it in the ant properties box like test=${TEST} then I have this output :

            [echo] test=${TEST}

            ilot ilot added a comment - I have the same issue on 1.384. when I define a global property (name=TEST and value=MYVALUE) in "Hudson/Manage Hudson/Configure System/Global Properties" and I use it in the ant properties box like test=${TEST} then I have this output : [echo] test=${TEST}
            abayer Andrew Bayer made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 134774 ] JNJira + In-Review [ 203053 ]

            People

              abayer Andrew Bayer
              abrugger abrugger
              Votes:
              2 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: