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

Checkout directory created incorrectly if the variable is not echoed first

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 5.0
    • 4.2.1
    • Plan Branches

    Description

      My plan is configured this way:

      • Default Job:
        • Task 1: Source Code Checkout
          • Repository: Subversion
          • Checkout Directory:
            ${bamboo.repository.branch.name}
            
        • Task 2: Script
          • Script Location: Inline
          • Script Body:
            echo "${bamboo.repository.branch.name} Done"
            

      When I run the build, this is the result:

      11-Out-2012 15:14:07	Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
      11-Out-2012 15:14:07	Running preRetrieveSourceCode task...
      11-Out-2012 15:14:08	Updating source code to revision: 15
      11-Out-2012 15:14:08	Existing workspace found at 'D:\Atlassian\atlassian-bamboo-4.2.1\bamboo_home\xml-data\build-dir\PROJ-PLAN-JOB1\${bamboo.repository.branch.name}'. updating...
      11-Out-2012 15:14:09	Updated source code to revision: 15
      11-Out-2012 15:14:09	Running postRetrieveSourceCode task...
      11-Out-2012 15:14:09	Finished task 'Checkout Default Repository'
      ...
      
      11-Out-2012 15:14:09	Substituting variable: ${bamboo.repository.branch.name} with branch2
      ...
      11-Out-2012 15:14:09	Starting task 'Shell Command' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
      11-Out-2012 15:14:09	D:\Atlassian\atlassian-bamboo-4.2.1\bamboo_home\xml-data\build-dir\PROJ-PLAN-JOB1>echo "branch2 Done" 
      11-Out-2012 15:14:09	"branch2 Done"
      11-Out-2012 15:14:09	Finished task 'Shell Command'
      

      As can be seen, the code was checked out / updated into this directory:

      BAMBOO_HOME\xml-data\build-dir\PROJ-PLAN-JOB1\${bamboo.repository.branch.name}
      

      Note that the variable was not replaced by its value, which should be branch2.

      The interesting thing is that, if I invert the order of the tasks, making the Script task run before the Source Code Checkout, the build result is the expected:

      11-Out-2012 15:15:59	Substituting variable: ${bamboo.repository.branch.name} with branch2
      11-Out-2012 15:15:59	Starting task 'Shell Command' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
      11-Out-2012 15:15:59	D:\Atlassian\atlassian-bamboo-4.2.1\bamboo_home\xml-data\build-dir\PROJ-PLAN-JOB1>echo "branch2 Done" 
      11-Out-2012 15:15:59	"branch2 Done"
      11-Out-2012 15:15:59	Finished task 'Shell Command'
      ...
      11-Out-2012 15:15:59	Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
      11-Out-2012 15:15:59	Running preRetrieveSourceCode task...
      11-Out-2012 15:15:59	Updating source code to revision: 15
      11-Out-2012 15:15:59	Working directory 'D:\Atlassian\atlassian-bamboo-4.2.1\bamboo_home\xml-data\build-dir\PROJ-PLAN-JOB1\branch2' is empty. Checking out SVN URL 'file:///D:/Atlassian/Repositories/SVN/branches/branch2'
      11-Out-2012 15:16:00	Updated source code to revision: 15
      11-Out-2012 15:16:00	Running postRetrieveSourceCode task...
      11-Out-2012 15:16:00	Finished task 'Checkout Default Repository'
      

      As can be seen here, the source code was checked out into the correct directory:

      BAMBOO_HOME\xml-data\build-dir\PROJ-PLAN-JOB1\branch2
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fkraemer Felipe Kraemer
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: