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

regression parsing Artifact path in ScpTask 6.4.0

    XMLWordPrintable

Details

    Description

      Summary

      If an Artifact download task has the Download path "./" specified then the artifact is successfully downloaded
      to the current build directory but a following ScpTask referencing the full path including ..././xx fails to copy the file.

      Specifying "./" as the download directory worked before 6.4.0 but now fails.

      Steps to Reproduce

      1. Create a new plan
      2. Stage 1. job 1

      • Define shared artifact - testa, **/*.txt
      • Script Task - echo hello > testa.txt

      3. Stage 2. job 1

      • Artifact download Task. specify testa artifact and "./" as download path.
      • ScpTask - specify testa artifact

      4. run job

      Expected Results

      The ScpTask succeeds. In build log we see..

      ...
      simple	17-May-2018 01:41:10	Starting task 'Artifact download' of type 'com.atlassian.bamboo.plugins.bamboo-artifact-downloader-plugin:artifactdownloadertask'
      simple	17-May-2018 01:41:10	Preparing to download plan result TST-TST-1 artifact: Shared artifact: [testa], pattern: [**/*.txt]
      simple	17-May-2018 01:41:10	Artifact [testa] downloaded successfully in 3.646 ms to ./
      simple	17-May-2018 01:41:10	Finished task 'Artifact download' with result: Success
      simple	17-May-2018 01:41:10	Starting task 'SCP Task' of type 'com.atlassian.bamboo.plugins.bamboo-scp-plugin:scptask'
      simple	17-May-2018 01:41:10	Connecting to x.x.x.x on port: 22
      simple	17-May-2018 01:41:10	Uploading '/var/atlassian/application-data/bamboo/xml-data/build-dir/TST-TST-DOWN/./testa.txt' to '/tmp'...
      simple	17-May-2018 01:41:11	'/var/atlassian/application-data/bamboo/xml-data/build-dir/TST-TST-DOWN/./testa.txt' was uploaded successfully.
      simple	17-May-2018 01:41:11	Finished task 'SCP Task' with result: Success
      

      Actual Results

      The ScpTask fails. In build log we see..

      ...
      simple	17-May-2018 01:55:35	Starting task 'Artifact download' of type 'com.atlassian.bamboo.plugins.bamboo-artifact-downloader-plugin:artifactdownloadertask'
      simple	17-May-2018 01:55:35	Preparing to download plan result TST-TST-1 artifact: Shared artifact: [testa], pattern: [**/*.txt]
      simple	17-May-2018 01:55:35	Artifact [testa] downloaded successfully in 12.32 ms to ./
      simple	17-May-2018 01:55:35	Finished task 'Artifact download' with result: Success
      simple	17-May-2018 01:55:35	Starting task 'SCP Task' of type 'com.atlassian.bamboo.plugins.bamboo-scp-plugin:scptask'
      simple	17-May-2018 01:55:35	Connecting to x.x.x.x on port: 22
      simple	17-May-2018 01:55:36	Performing a recursive copy...
      error	17-May-2018 01:55:36	Copy Failed. Some files were not uploaded successfully.
      error	17-May-2018 01:55:36	'/var/atlassian/application-data/bamboo/xml-data/build-dir/TST-TST-DOWN/./testa.txt' was not uploaded.
      simple	17-May-2018 01:55:36	Finished task 'SCP Task' with result: Error
      

      Notes

      This appears to be a regression introduced with BAM-15445: SCP Task Recursive copy doesn't work if only one folder has files. (fixed in Bamboo 6.4.0)

      Workaround

      If the download path for the Artifact download task is left blank, defaulting to the current directory
      then all works fine.

      Attachments

        Issue Links

          Activity

            People

              achystoprudov Alexey Chystoprudov
              cberry@atlassian.com Chris Berry
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: