Details
Description
Issue Summary
If a plan in Bamboo is having "bamboo.planRepository.<position>.previousRevision" system variable and if you try to rerun a build, it will fail with an error
This is reproducible on Data Center: (yes)
Steps to Reproduce
- Define a plan in Bamboo with a simple script task and link any repository to this plan
- In the script task try to print the value of the variable using the below command
echo ${bamboo.planRepository.previousRevision}
- Run the build for the first time, it will complete successfully
- Rerun the same build
Expected Results
- The build should complete successfully
Actual Results
- The build fails with the below exception
/var/atlassian/application-data/bamboo/temp/SCRIP-TIC-JOB1-228-ScriptBuildTask-9328576534053004432.sh: 1: Bad substitution Failing task since return code of [/var/atlassian/application-data/bamboo/temp/SCRIP-TIC-JOB1-228-ScriptBuildTask-9328576534053004432.sh] was 2 while expected 0
Workaround
Workaround is to run a fresh build and the plan will successfully complete.