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
- 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)
- 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
- Create an Artifact definition as per following:
Name: myArtifact Location: Copy pattern: executable.jar [x] Shared
- 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
- 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.