Variables defined in each stage, job or script cannot be passed. It would be nice if the variables can be defined in one stage/job/script only and they can be reused again..
For example:
project:project:
key: EXAMPLE
plan:
key: EXAMPLECI
name: EXAMPLE-CI
stages:
- jobs:
- scripts:
- '#!/bin/bash'
- VERSION = 1.0.0
interpreter: shell - jobs:
- scripts:
- '#!/bin/bash'
// Variable $VERSION from previous job cannot be used here
interpreter: shell
Solution
Use Inject Variables task to pass variables across all phases of plan execution. This task can be defined in Bamboo Specs.