Skip to:
Bamboo 5.7 introduced local scope and result scope variables. These resolve many issues people have had specifically with Deployment Versions:
https://bitbucket.org/dehringer/bamboo-maven-pom-extractor-plugin/issue/7
https://bitbucket.org/dehringer/bamboo-maven-pom-extractor-plugin/issue/5
https://bitbucket.org/dehringer/bamboo-maven-pom-extractor-plugin/issue/3 (see comments)
Marcin Gardias [Atlassian] added a comment - 16/Oct/14 11:23 AM - editedAs of Bamboo 5.7 the correct way to add variables at runtime is:
@Override public TaskResult execute(@NotNull CommonTaskContext taskContext) throws TaskException { final VariableContext variableContext = taskContext.getCommonContext().getVariableContext(); variableContext.addResultVariable("mykey", "myvalue"); //add result-scoped variable variableContext.addLocalVariable("myotherkey", "myothervalue"); //add local-scoped variable // (...) }
where"result-scoped" variable is persisted with the result and can be accessed in subsequent stages and in related deployments, while "local-scoped" variable disappears when current job's execution ends.
Bamboo 5.7 introduced local scope and result scope variables. These resolve many issues people have had specifically with Deployment Versions:
https://bitbucket.org/dehringer/bamboo-maven-pom-extractor-plugin/issue/7
https://bitbucket.org/dehringer/bamboo-maven-pom-extractor-plugin/issue/5
https://bitbucket.org/dehringer/bamboo-maven-pom-extractor-plugin/issue/3 (see comments)
Details from Atlassian
Marcin Gardias [Atlassian] added a comment - 16/Oct/14 11:23 AM - edited
As of Bamboo 5.7 the correct way to add variables at runtime is:
@Override public TaskResult execute(@NotNull CommonTaskContext taskContext) throws TaskException { final VariableContext variableContext = taskContext.getCommonContext().getVariableContext(); variableContext.addResultVariable("mykey", "myvalue"); //add result-scoped variable variableContext.addLocalVariable("myotherkey", "myothervalue"); //add local-scoped variable // (...) }
where
"result-scoped" variable is persisted with the result and can be accessed in subsequent stages and in related deployments, while "local-scoped" variable disappears when current job's execution ends.