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

Artifact Download Task does not expand variables on Bamboo 9

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Highest
    • 9.0.1, 9.1.0
    • 9.0.0
    • Artifacts
    • None

    Description

      Problem

      This is reproducible on Data Center: 

      Artifact Download Task is not expanding variables on Bamboo 9.

      This is a regression as it is not reproducible in Bamboo <= 8.2

      Environment

      Bamboo 9 (not reproducible on Bamboo 8)

      Steps to Reproduce

      1. Add an Artifact Download task to a Plan
      2. Set the Destination path as a Global, Project or Plan variable (it even works with injected variables)

      Expected Results

      Bamboo should expand the variables and store the artifacts correctly

      Actual Results

      Bamboo treats the variables as strings and stores the artifacts in literal folders named after the variable names. E.g.:

      [bamboo@bambooserver ABC-CON-JOB1]$ ls -al
      total 8
      drwxr-x---.  2 bamboo bamboo   24 Sep 29 13:57 '${bamboo.buildNumber}'

      Workarounds

      Option 1:

      • Do not use variables on the Destination Path

      Option 2:

      • Add a Script task before the Artifact Download task that would:
        • Create static folders based on the variables names you desire
          and
        • Create symbolic links pointing to the recently created folders
          # Using ${bamboo.product_name_core} as an example
          # It can be any variable
          
          # Create the folder based on the variable value
          mkdir ${bamboo.product_name_core}
          
          # On Linux run
          ln -s ${bamboo_product_name_core} static-product-name-core
          
          # On Windows run
          # mklink /D ${bamboo.product_name_core} static-product-name-core
          
      • Use the symbolic link location (static-product-name-core) on the Destination Path of the Artifact Download task

      Notes

      Attachments

        Issue Links

          Activity

            People

              851f15845f55 Mateusz Szmal
              73868399605e Eduardo Alvarenga
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: