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

Inject variable task as final task does not add variables to the result scope when a build fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 9.0.1, 9.1.0, 8.2.7
    • 8.2.3
    • Tasks, Variables
    • None

    Description

      Inject variable task as final task does not work when a build fails

      Issue Summary

      If a job has inject variables task ( injecting in build Result ) in the list of final tasks, those variables are not injected in case the build fails.

      This is reproducible on Data Center: (yes)

      Steps to Reproduce

      1. create a plan with two final tasks, one that generates the file containing the variables to be injected and the inject variable task.
      2. ensure that the plan will fail
      3. run the plan

      You can use: inj.specs

      Expected Results

      The variable is injected in the build context and available on the build results metadata (tab on the build result)

      Actual Results

      The variable is not injected in the build context

      The logs indicate that the variable should be injected:

      21-Sep-2022 10:26:27 	Finished task 'error' with result: Failed
      21-Sep-2022 10:26:27 	Starting task 'generate variable' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
      21-Sep-2022 10:26:27 	
      Beginning to execute external process for build 'project one - artifact handling - Default Job #12 (PO-AH-JOB1-12)'
       ... running command line: 
      /var/atlassian/application-data/bamboo/temp/PO-AH-JOB1-12-ScriptBuildTask-2878369868830523477.sh
       ... in: /var/atlassian/application-data/bamboo/local-working-dir/1146881/PO-AH-JOB1
      21-Sep-2022 10:26:27 	hello
      21-Sep-2022 10:26:27 	Finished task 'generate variable' with result: Success
      21-Sep-2022 10:26:27 	Starting task 'inject variable' of type 'com.atlassian.bamboo.plugins.bamboo-variable-inject-plugin:inject'
      21-Sep-2022 10:26:27 	Injected variable bamboo.inject.testingvariable=test in RESULT scope
      21-Sep-2022 10:26:27 	Finished task 'inject variable' with result: Success
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Attachments

        Issue Links

          Activity

            People

              mgardias Marcin Gardias
              sorlovski Zaro
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: