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

Variables saved with the variableDefinitionManager in one stage should be available in later stages

    XMLWordPrintable

Details

    • 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.

    Description

      Use case

      A task may define some custom build variable that would need to later be retrieved in subsequent tasks.
      The current mechanism to handle this is to share artifacts between the tasks - the problem with this approach is that the "native" bamboo tasks, such as the ant task could not access this "custom build variables"; we would need to write a wrapper script that parses the artifact then invoked the ant command.

      Tested case

      I created custom build variables using the variableDefinitionManager

      VariableDefinition vd = new VariableDefinitionImpl();
      vd.setPlan(plan); 
      vd.setVariableType(VariableType.PLAN);
      vd.setKey(k);
      vd.setValue(v);
      variableDefinitions.add( vd );
       variableDefinitionManager.saveVariableDefinitions(variableDefinitions);
      
      what currently works:

      *Pass variables between tasks

         Plan
            Stage 1
                Job1
                    task 1A: set_plan_variable myVar
                    task 1B : print_variable myVar
      
      What does not work:
      • Pass variables between a jobs (expected not to work since jobs can be concurrent)
      • Pass variables between a stages
           Plan
              Stage 1
                  Job1
                      task 1A: set_plan_variable myVar
              Stage 2:
                  Job1
                      task 2A : print_variable myVar
        

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              65de048e0dc4 Nassim Kammah
              Votes:
              19 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: