Description
The documentation mentions repository.previous.revision.number variable; however, the substitution in a simple script file doesn't work.
Here is the log showing that repository.previous.revision.number doesn't get substituted (I tried with and without adding a source code checkout task for the same job):
16-Jan-2012 09:54:49 Build PROJ1-PLAN1-JOB2-14 started building on agent Default Agent 16-Jan-2012 09:54:49 Build working directory is /Users/akhachatryan/Atlassian/BambooHome3.4/xml-data/build-dir/PROJ1-PLAN1-JOB2 16-Jan-2012 09:54:49 Executing build PROJ1-PLAN1-JOB2-14 16-Jan-2012 09:54:49 Starting task 'Source Code Checkout' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout' 16-Jan-2012 09:54:49 Updating source code to revision: 753b44bddb0d2409278e86aac3a8ff502999bc18 16-Jan-2012 09:54:49 Fetching branch 'refs/heads/master' from 'file:///Users/akhachatryan/dev/Repositories/GitTest'. Will try to do a shallow fetch. 16-Jan-2012 09:54:49 Checking out revision 753b44bddb0d2409278e86aac3a8ff502999bc18. 16-Jan-2012 09:54:50 Already on 'master' 16-Jan-2012 09:54:50 Updated source code to revision: 753b44bddb0d2409278e86aac3a8ff502999bc18 16-Jan-2012 09:54:50 Finished task 'Source Code Checkout' 16-Jan-2012 09:54:50 Running pre-build action: Build Number Stamper 16-Jan-2012 09:54:50 Running pre-build action: Clover Grails PreBuild Action 16-Jan-2012 09:54:50 Running pre-build action: VCS Version Collector 16-Jan-2012 09:54:50 Running pre-build action: Repository Isolation Enabler Action 16-Jan-2012 09:54:50 Running pre-build action: Maven Settings Prebuild Action 16-Jan-2012 09:54:50 Substituting variable: ${bamboo.buildNumber} with 14 16-Jan-2012 09:54:50 Substituting variable: ${bamboo.repository.revision.number} with 753b44bddb0d2409278e86aac3a8ff502999bc18 16-Jan-2012 09:54:50 Starting task 'Script' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script' 16-Jan-2012 09:54:50 Beginning to execute external process for build 'Project-1 - Plan-1 - Job-2' ... running command line: /bin/sh /var/folders/gl/0lz__sg17fn4z5gcl_lsb66m0000gp/T/PROJ1-PLAN1-JOB2-14-ScriptBuildTask-4679423102074398494.sh ... in: /Users/akhachatryan/Atlassian/BambooHome3.4/xml-data/build-dir/PROJ1-PLAN1-JOB2 16-Jan-2012 09:54:50 14 16-Jan-2012 09:54:50 753b44bddb0d2409278e86aac3a8ff502999bc18 16-Jan-2012 09:54:50 /var/folders/gl/0lz__sg17fn4z5gcl_lsb66m0000gp/T/PROJ1-PLAN1-JOB2-14-ScriptBuildTask-4679423102074398494.sh: line 3: ${bamboo.repository.previous.revision.number}: bad substitution 16-Jan-2012 09:54:50 Failing task since return code was 1 while expected 0 16-Jan-2012 09:54:50 Finished task 'Script' 16-Jan-2012 09:54:50 Running post build plugin 'NCover Results Collector' 16-Jan-2012 09:54:50 Running post build plugin 'Clover Results Collector' 16-Jan-2012 09:54:50 Running post build plugin 'Artifact Copier' 16-Jan-2012 09:54:50 Running post build plugin 'Cleanup Build Processor' 16-Jan-2012 09:54:50 Finalising the build... 16-Jan-2012 09:54:50 Stopping timer. 16-Jan-2012 09:54:50 Build PROJ1-PLAN1-JOB2-14 completed. 16-Jan-2012 09:54:50 Running on server: post build plugin 'NCover Results Collector' 16-Jan-2012 09:54:50 Running on server: post build plugin 'Clover Delta Calculator' 16-Jan-2012 09:54:50 Running on server: post build plugin 'Build Hanging Detection Configuration' 16-Jan-2012 09:54:50 Running on server: post build plugin 'Maven Dependencies Postprocessor' 16-Jan-2012 09:54:50 All post build plugins have finished 16-Jan-2012 09:54:50 Generating build results summary... 16-Jan-2012 09:54:50 Saving build results to disk... 16-Jan-2012 09:54:50 Indexing build results... 16-Jan-2012 09:54:50 Finished building PROJ1-PLAN1-JOB2-14.
Also, note that buildNumber and repository.revision.number variables do get substituted.