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

Add the PROMOTION_ENV token macro

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Promotion is an independent job type, which has its own environment. Several promotion-oriented build steps may need an environment or artifacts of the original builds, so they may call the TokenMacro resolution against the build.

      In particular cases we're interested to support environment variables from both Promotion and original build. In such case it would be great to have a PROMOTION_ENV macro, which finds the source promotion job by the current executor context. In such case ENV and PROMOTION_ENV macros will allow to extract variables from both jobs.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            pom.xml
            src/main/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacro.java
            src/main/resources/hudson/plugins/promoted_builds/tokenmacro/help.jelly
            src/test/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacroTest.java
            http://jenkins-ci.org/commit/promoted-builds-plugin/3c38412146343a41909ff15cbfc1f91efb0c6a31
            Log:
            [FIXED JENKINS-30411] - Add the PROMOTION_ENV token macro

            Promotion is an independent job type, which has its own environment. Several promotion-oriented build steps may need an environment or artifacts of the original builds, so they may call the TokenMacro resolution against the build.

            In particular cases we're interested to support environment variables from both Promotion and original build. In such case it would be great to have a PROMOTION_ENV macro, which finds the source promotion job by the current executor context. In such case ENV and PROMOTION_ENV macros will allow to extract variables from both jobs.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: pom.xml src/main/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacro.java src/main/resources/hudson/plugins/promoted_builds/tokenmacro/help.jelly src/test/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacroTest.java http://jenkins-ci.org/commit/promoted-builds-plugin/3c38412146343a41909ff15cbfc1f91efb0c6a31 Log: [FIXED JENKINS-30411] - Add the PROMOTION_ENV token macro Promotion is an independent job type, which has its own environment. Several promotion-oriented build steps may need an environment or artifacts of the original builds, so they may call the TokenMacro resolution against the build. In particular cases we're interested to support environment variables from both Promotion and original build. In such case it would be great to have a PROMOTION_ENV macro, which finds the source promotion job by the current executor context. In such case ENV and PROMOTION_ENV macros will allow to extract variables from both jobs.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            pom.xml
            src/main/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacro.java
            src/main/resources/hudson/plugins/promoted_builds/tokenmacro/help.jelly
            src/test/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacroTest.java
            http://jenkins-ci.org/commit/promoted-builds-plugin/71dd42048d54d9984bbf6a1710d6f99729659452
            Log:
            [FIXED JENKINS-30411] - Add the PROMOTION_ENV token macro

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: pom.xml src/main/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacro.java src/main/resources/hudson/plugins/promoted_builds/tokenmacro/help.jelly src/test/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacroTest.java http://jenkins-ci.org/commit/promoted-builds-plugin/71dd42048d54d9984bbf6a1710d6f99729659452 Log: [FIXED JENKINS-30411] - Add the PROMOTION_ENV token macro
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            pom.xml
            src/main/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacro.java
            src/main/resources/hudson/plugins/promoted_builds/tokenmacro/help.jelly
            src/test/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacroTest.java
            http://jenkins-ci.org/commit/promoted-builds-plugin/59fa76a11661d2aa9c1be1f283505ada87661b69
            Log:
            Merge pull request #67 from jenkinsci/JENKINS-30411

            [FIXED JENKINS-30411] - Add the PROMOTION_ENV token macro

            Compare: https://github.com/jenkinsci/promoted-builds-plugin/compare/2a2ea4d0be78...59fa76a11661

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: pom.xml src/main/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacro.java src/main/resources/hudson/plugins/promoted_builds/tokenmacro/help.jelly src/test/java/hudson/plugins/promoted_builds/tokenmacro/PromotedEnvVarTokenMacroTest.java http://jenkins-ci.org/commit/promoted-builds-plugin/59fa76a11661d2aa9c1be1f283505ada87661b69 Log: Merge pull request #67 from jenkinsci/ JENKINS-30411 [FIXED JENKINS-30411] - Add the PROMOTION_ENV token macro Compare: https://github.com/jenkinsci/promoted-builds-plugin/compare/2a2ea4d0be78...59fa76a11661
            Hide
            mdkf Michael Fowler added a comment -

            Is it expected that PROMOTION_ENV should be able to retrieve env vars added or changed by the env_inject plugin?

            Show
            mdkf Michael Fowler added a comment - Is it expected that PROMOTION_ENV should be able to retrieve env vars added or changed by the env_inject plugin?
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            It should.

            Show
            oleg_nenashev Oleg Nenashev added a comment - It should.
            Hide
            mdkf Michael Fowler added a comment -

            Oleg Nenashev Thanks. It's only working for the variables set prior to the jobs run for me. Should I open a separate ticket?

            Show
            mdkf Michael Fowler added a comment - Oleg Nenashev Thanks. It's only working for the variables set prior to the jobs run for me. Should I open a separate ticket?

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                oleg_nenashev Oleg Nenashev
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: