Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-10607

Using Global variable to get the SVN repository revision does not work properly if using more than 1 SVN repo

    XMLWordPrintable

Details

    Description

      If user is having more then one check out repository task then the global variable getting the revision will not work properly:

      Steps to replicate the problem:

      1. Create a new plan Configure
      2. Configure the JOB task as follow:
        • Check out task repository 1
        • Script task with the following command:
          echo ${bamboo.custom.svn.revision.number}
          
        • Check out task repository 2
          echo ${bamboo.custom.svn.revision.number}
          
      3. Save the changes and run the plan

      Build log:

      12-Jan-2012 21:58:00 	Build SIMPLEJUNIT-SIMPLEJUNIT-JOB1-6 started building on agent Default Agent
      12-Jan-2012 21:58:00 	Build working directory is C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1
      12-Jan-2012 21:58:00 	Executing build SIMPLEJUNIT-SIMPLEJUNIT-JOB1-6
      12-Jan-2012 21:58:00 	Starting task 'Source Code Checkout' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
      12-Jan-2012 21:58:00 	Running preRetrieveSourceCode task...
      12-Jan-2012 21:58:00 	Existing source path at 'C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1' is 'http://localhost:81/svn/simpleJUNIT/trunk' and differs from 'http://localhost:81/svn/SimpleJunitFail/trunk'
      12-Jan-2012 21:58:00 	Clean checkout enforced by repository configuration
      12-Jan-2012 21:58:00 	Cleaning build directory 'C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1'
      12-Jan-2012 21:58:01 	Updating source code to revision: 3
      12-Jan-2012 21:58:01 	Working directory 'C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1' is empty. Checking out SVN URL 'http://localhost:81/svn/SimpleJunitFail/trunk'
      12-Jan-2012 21:58:07 	Updated source code to revision: 3
      12-Jan-2012 21:58:07 	Running postRetrieveSourceCode task...
      12-Jan-2012 21:58:07 	Finished task 'Source Code Checkout'
      12-Jan-2012 21:58:07 	Running pre-build action: Build Number Stamper
      12-Jan-2012 21:58:07 	Running pre-build action: Clover Grails PreBuild Action
      12-Jan-2012 21:58:07 	Running pre-build action: VCS Version Collector
      12-Jan-2012 21:58:07 	Running pre-build action: Repository Isolation Enabler Action
      12-Jan-2012 21:58:07 	Running pre-build action: Maven Settings Prebuild Action
      12-Jan-2012 21:58:07 	
      Substituting variable: ${bamboo.custom.svn.lastchange.revision.number} with 112
      12-Jan-2012 21:58:07 	Starting task 'Script' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
      12-Jan-2012 21:58:07 	
      Beginning to execute external process for build 'SimpleJunit - SimpleJunit - Default Job'
      ... running command line:
      C:\Windows\Temp\SIMPLEJUNIT-SIMPLEJUNIT-JOB1-6-ScriptBuildTask-19061.bat
      ... in: C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1
      12-Jan-2012 21:58:07 	
      12-Jan-2012 21:58:07 	C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1>echo 112
      12-Jan-2012 21:58:07 	112
      12-Jan-2012 21:58:07 	Finished task 'Script'
      12-Jan-2012 21:58:07 	Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
      12-Jan-2012 21:58:07 	Running preRetrieveSourceCode task...
      12-Jan-2012 21:58:07 	Existing source path at 'C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1' is 'http://localhost:81/svn/SimpleJunitFail/trunk' and differs from 'http://localhost:81/svn/simpleJUNIT/trunk'
      12-Jan-2012 21:58:07 	Clean checkout enforced by repository configuration
      12-Jan-2012 21:58:07 	Cleaning build directory 'C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1'
      12-Jan-2012 21:58:08 	Updating source code to revision: 112
      12-Jan-2012 21:58:08 	Working directory 'C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1' is empty. Checking out SVN URL 'http://localhost:81/svn/simpleJUNIT/trunk'
      12-Jan-2012 21:58:14 	Updated source code to revision: 112
      12-Jan-2012 21:58:14 	Running postRetrieveSourceCode task...
      12-Jan-2012 21:58:14 	Finished task 'Checkout Default Repository'
      12-Jan-2012 21:58:14 	
      Substituting variable: ${bamboo.custom.svn.lastchange.revision.number} with 112
      12-Jan-2012 21:58:14 	Starting task 'Script' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
      12-Jan-2012 21:58:14 	
      Beginning to execute external process for build 'SimpleJunit - SimpleJunit - Default Job'
      ... running command line:
      C:\Windows\Temp\SIMPLEJUNIT-SIMPLEJUNIT-JOB1-6-ScriptBuildTask-19062.bat
      ... in: C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1
      12-Jan-2012 21:58:14 	
      12-Jan-2012 21:58:14 	C:\BambooProduct\bamboo3.4\home\xml-data\build-dir\131073\SIMPLEJUNIT-SIMPLEJUNIT-JOB1>echo 112
      12-Jan-2012 21:58:14 	112
      12-Jan-2012 21:58:14 	Finished task 'Script'
      12-Jan-2012 21:58:14 	Running post build plugin 'NCover Results Collector'
      12-Jan-2012 21:58:14 	Running post build plugin 'Clover Results Collector'
      12-Jan-2012 21:58:14 	Running post build plugin 'Artifact Copier'
      12-Jan-2012 21:58:14 	Running post build plugin 'Cleanup Build Processor'
      12-Jan-2012 21:58:14 	Finalising the build...
      12-Jan-2012 21:58:14 	Stopping timer.
      12-Jan-2012 21:58:14 	Build SIMPLEJUNIT-SIMPLEJUNIT-JOB1-6 completed.
      12-Jan-2012 21:58:14 	Running on server: post build plugin 'NCover Results Collector'
      12-Jan-2012 21:58:14 	Running on server: post build plugin 'Clover Delta Calculator'
      12-Jan-2012 21:58:14 	Running on server: post build plugin 'Build Hanging Detection Configuration'
      12-Jan-2012 21:58:14 	Running on server: post build plugin 'Maven Dependencies Postprocessor'
      12-Jan-2012 21:58:14 	All post build plugins have finished
      12-Jan-2012 21:58:14 	Generating build results summary...
      12-Jan-2012 21:58:14 	Saving build results to disk...
      12-Jan-2012 21:58:14 	Indexing build results...
      12-Jan-2012 21:58:14 	Finished building SIMPLEJUNIT-SIMPLEJUNIT-JOB1-6.
      

      SVN information:

      C:\Users\XZws>svn info http://localhost:81/svn/SimpleJunitFail/trunk/
      Path: trunk
      URL: http://localhost:81/svn/SimpleJunitFail/trunk
      Repository Root: http://localhost:81/svn/SimpleJunitFail
      Repository UUID: d28ef53e-dc8f-cb47-974a-de57de57fe66
      Revision: 3
      Node Kind: directory
      Last Changed Author: admin
      Last Changed Rev: 3
      Last Changed Date: 2011-12-29 18:59:27 +0800 (Thu, 29 Dec 2011)
      
      
      C:\Users\XZws>svn info http://localhost:81/svn/SimpleJunit/trunk/
      Path: trunk
      URL: http://localhost:81/svn/SimpleJunit/trunk
      Repository Root: http://localhost:81/svn/SimpleJunit
      Repository UUID: cd9e2243-a36b-d548-9eab-7e6566b9641d
      Revision: 112
      Node Kind: directory
      Last Changed Author: admin
      Last Changed Rev: 112
      Last Changed Date: 2012-01-04 18:57:07 +0800 (Wed, 04 Jan 2012)
      

      This also happens to repository.revision.number variable too

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zyap Zed Yap [Atlassian]
              Votes:
              9 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: