Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bamboo failing when creating a tar file

James Murray June 11, 2015

hello,

I've been having some issues with bamboo when trying to create a tar file.

I've got a simple task which runs the command current build directory:

/bin/tar -czf archive.tgz ./

I do this to create an archive of my current code so that I can upload it to the target server.

 

When the plan runs, it always fails with the following:

 

11-Jun-2015 14:34:17 Beginning to execute external process for build 'Project - Plan - Default Job #20 (BV3-WWW-JOB1-20)'\n ... running command line: \n/bin/tar -czf archive.tgz ./\n ... in: /opt/atlassian/bamboo-home/xml-data/build-dir/BV3-WWW-JOB1\
11-Jun-2015 14:34:21 /bin/tar: .: file changed as we read it
11-Jun-2015 14:34:21 Failing task since return code of [/bin/tar -czf archive.tgz ./] was 1 while expected 0
11-Jun-2015 14:34:21 Finished task 'Create Tar File' with result: Failed
11-Jun-2015 14:34:21 Running post build plugin 'Artifact Copier'
11-Jun-2015 14:34:21 Publishing an artifact: Archive
11-Jun-2015 14:34:22 Finished publishing of artifact Shared artifact: [Archive], pattern: [archive.tgz] in 0s

 

As you can see, it produces the archive.tgz and it even publishes the artifact. but the plan still fails because of the tar command.

I just don't know what to do about it at this point.

 

Any help is appreciated.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
James Murray June 11, 2015

AH! I answered my own question. but I'm going to leave this here in case anyone else has this problem.

The issue was not bamboo. Bamboo was simply doing what it's supposed to do. The issue was with my tar command.

 

I was running tar in the build directory ./ while righting the tar file to the build directory (I was producing ./archive.tgz)

The tar command saw that there was a change to a file in ./ and threw an error. To fix this I simply specified the files I wanted to add to my archive:

/bin/tar -czf archive.tgz ./dir1/ ./dir2/ ./dir3/.... etc

 

I hope maybe this helps someone in the future. 

starkb January 23, 2016

Thank you!  Saved me some major headaches smile

TAGS
AUG Leaders

Atlassian Community Events