Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-11824

Pass the build-specific variables automatically into environment variables (like plan/global variables do)

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Steps to reproduce:

      1) create plan, script task:

      echo $bamboo_buildResultKey
      echo $bamboo_buildNumber
      

      2) run the plan
      3a) expected result (in the logs) is to see something like

      PROJ-PLAN-JOB1-1
      1
      

      3b) while current behavior is:

      
      

      (these environment variables are undefined, that's why we see empty logs)

      Seems we pass the plan/global variables into the environment:

      But we don't do that for built-in variables like:

      • ${bamboo.buildPlanName}
      • ${bamboo.buildKey}
      • ${bamboo.buildNumber}
      • ${bamboo.buildResultKey}
      • ${bamboo.buildTimeStamp}
      • ${bamboo.repository.revision.number}
      • ${bamboo.build.working.directory}
        etc...

            [BAM-11824] Pass the build-specific variables automatically into environment variables (like plan/global variables do)

            We are using version 5.7.2 and I have the following script with run as powershell marked:

            echo "Variables"
            echo $bamboo_buildNumber
            echo $bamboo_build_mode

            The output is simply:
            Variables

            So it appears the issue still is happening for global and plan variables at least in 5.7.2

            Tim Schroeder added a comment - We are using version 5.7.2 and I have the following script with run as powershell marked: echo "Variables" echo $bamboo_buildNumber echo $bamboo_build_mode The output is simply: Variables So it appears the issue still is happening for global and plan variables at least in 5.7.2

            Plan level variables still do not appear to work in script tasks (when powershell script is enabled). I am trying to pass a plan level variable to my powershell script and cannot get it to work. Global variables work fine but plan level do not. Please advise.

            Jason Kirton (Inactive) added a comment - Plan level variables still do not appear to work in script tasks (when powershell script is enabled). I am trying to pass a plan level variable to my powershell script and cannot get it to work. Global variables work fine but plan level do not. Please advise.

            Is it possible to disable this new behaviour? This is now preventing our builds from completing due to an excessively large process environment (see http://stackoverflow.com/a/9722623/995058)

            Anthony Williams added a comment - Is it possible to disable this new behaviour? This is now preventing our builds from completing due to an excessively large process environment (see http://stackoverflow.com/a/9722623/995058 )

            This is going to DRAMATICALLY simplify all of our build and deploy plans. We had to use "shell" for EVERY build step just to get the right variables injected, but now we don't have to. Thanks!

            dustin_barnes added a comment - This is going to DRAMATICALLY simplify all of our build and deploy plans. We had to use "shell" for EVERY build step just to get the right variables injected, but now we don't have to. Thanks!

            This is beyond awesome. Thank you.

            Eric Fusciardi added a comment - This is beyond awesome. Thank you.

            AlexZ added a comment -

            WOW! Great!
            Thank you so much!
            ATLASSIAN ROCKS!!!

            AlexZ added a comment - WOW! Great! Thank you so much! ATLASSIAN ROCKS!!!

            Nice! Finally!

            Matthew Korich added a comment - Nice! Finally!

            We are adding this feature to Bamboo 5.6

            Marcin Gardias added a comment - We are adding this feature to Bamboo 5.6

            AlexZ added a comment -

            Team, almost two years of silence? Are you okay? Please fix this bug.

            AlexZ added a comment - Team, almost two years of silence? Are you okay? Please fix this bug.

            I would like bamboo.agentID as well.

            Christopher Woodruff added a comment - I would like bamboo.agentID as well.

              mgardias Marcin Gardias
              pstefaniak PiotrA
              Votes:
              85 Vote for this issue
              Watchers:
              61 Start watching this issue

                Created:
                Updated:
                Resolved: