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

XMLWordPrintable

      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
        

        1. 12345.txt
          0.0 kB
          Angie Basini

              Assignee:
              Unassigned
              Reporter:
              Nassim Kammah
              Votes:
              19 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: