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

Shared artifact built on remote agent does not preserve permissions with a Windows Bamboo Server

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • None
    • Artifacts, Windows
    • None
    • 0
    • 2
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Problem Description

      A shared artifact built on a remote agent on a unix based OS with a Windows Bamboo Server does not preserve the permissions as originally built when used in an Artifact download task on a deployment plan. This doesn't occur when for example your Bamboo Server and remote agent are both on unix systems.

      Environment

      • Windows Bamboo Server
      • Remote Agent (Tested on OSX and Ubuntu)

      Steps to Reproduce

      1. Create a new Project (i.e.: Support), Plan (i.e.: MyPlan), disable your local agents and connect your unix remote agent (or dedicate it to the plan)
      2. Add n "Script" task
        # creates a new file
        touch executable.jar
        
        # list files
        ls -l
        
        # change its permission
        chmod 744 executable.jar
        
        # list files
        ls -l
        

        As a result you would have something like this in the build-dir:

        12-Dec-2014 14:08:52	total 0
        12-Dec-2014 14:08:52	-rw-r--r--  1 root  root  0 Dec 12 14:08 executable.jar
        
        12-Dec-2014 14:08:52	total 0
        12-Dec-2014 14:08:52	-rwxr--r--  1 root  root  0 Dec 12 14:08 executable.jar
        
      3. Create an Artifact definition as per following:
        Name: myArtifact
        Location:
        Copy pattern: executable.jar
        [x] Shared
        
      4. Go to "<bamboo-home>/artifacts" and run the following:
        ls -l SUP-MYPLAN/shared/build-00001/myArtifact/executable.jar
        

        As a result you would have something like (doesn't look like the permissions are preserved here either):

        -rw-r--r--  1 root  root  0 Dec 12 14:08 SUP-MYPLAN/shared/build-00001/myArtifact/executable.jar
        
      5. Create a deployment plan that runs on the same remote agent and consumes the artifact with an artifact download task
        As a result you would have this in the deployment working dir of the agent (note the executable bit is set across all groups):
        build	29-Jul-2016 14:19:13	/home/bamboo-agent/bamboo-agent-home/xml-data/build-dir/170196993-170295297
        build	29-Jul-2016 14:19:13	drwxr-xr-x 3 bamboo-agent bamboo-agent  4096 Jul 29 14:19 .
        build	29-Jul-2016 14:19:13	drwxr-xr-x 5 bamboo-agent bamboo-agent  4096 Jul 27 14:29 ..
        build	29-Jul-2016 14:19:13	-rwxr-xr-x 1 bamboo-agent bamboo-agent 26701 Jul 29 14:19 executable.jar
        

      Workaround

      • Write a script job that will re-set the correct permissions / rsync the files to destination using --chmod option to set the permissions
      • Tar everything up before creating the artifacts and then pass around a tarball rather than just pure artifacts.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jowen@atlassian.com Jeremy Owen
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: