unable to publish artifact [myFile.pkg]: null

Marcel Dannecker November 2, 2015

Hi folks,

I have a Plan that builds successfully and then tries to publish a artifact that is ~200MB in size.

But I always get the following error:

- Publishing an artifact: myFile.pkg
- Unable to publish artifact [myFile.pkg]: null
- Finished publishing of artifact Shared artifact: [myFile.pkg], pattern: [*.pkg] anchored at: [/tmp/package_build] in 0s
 

Inside "/tmp/package_build" is nothing else that the .pkg file

I tripple checked the typing of the path and if the file exists. It does.

 

Why is bamboo unable to publish the artifact?

Some research tell me that it is not the file size.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Marcel Dannecker November 2, 2015

Well was easy in the end.

Bamboo doesn't like absolute path to artifact (/tmp/package_build). Changed it to a relative one fixed it.

I just don't know why it says "null" if he follows the path from its working directory it should have said "file or directory doesn't exist".

otsile kesianye January 20, 2016

Hi Marcel, what change did you make to the path? Did you use /tmp/package_build? or a different path? Please paste the location. I am new and its unclear to me.

Marcel Dannecker January 21, 2016

Hi otsile kesianye,

the problem at all is that bamboo needs to be told how to get to the artifact based from its current working directory.

You could do it like me and just let bamboo copy the artifact into its working directory by a inline script where you can use an absolute path like you did and the bamboo internal variable for the working directory

(eg. "cp -r /tmp/package_build/* ${bamboo.build.working.directory}/")

Or you do the complex way that is likely to break if there is only one directory that changes.

Lets assume the working directory of bamboo is "/tmp/bamboo/builds/PLAN-KEY". To get your artifacts from "/tmp/package_build" you need to tell bamboo how to get there based on its current position in the directory tree. So your needed path would be "../../../package_build". With the double dots you tell Bamboo to go backwards in the tree by one directory. So with the 3 double dots you go back to "/tmp" and can go forward into "package_build".

I hope it is understandable.

otsile kesianye January 21, 2016

Thanks Marcel. I am still lost though.

I tried creating a script task and then creating artifacts as explained below but it did not work.

  https://answers.atlassian.com/questions/13413955

Can you send me a picture of;

  1. script task that creates a simple file
  2. picture of what to write in the location and copy pattern in the "Artifact Definitions"

Its a bit frustrating there are no How-to videos for Bambo.

Cheers

Marcel Dannecker January 22, 2016

To get used to artifacts.

Create a script task and paste in the following

file="my_artifact.txt"
touch $file
echo "foo" > $file
echo "bar" >> $file
echo " - - - "
echo $file

This will create a file named "my_artifact.txt" inside the working directory of the bamboo agent and write two lines to it "foo" in the first and "bar" in the second line. The last part just creates a short line and then prints out what is written in the file.

 

Now create a new definition for a artifact with the following.

Bildschirmfoto 2016-01-22 um 13.13.42.png
The Fields
Name: here you can specify a name for the artifact, this only means how it will be displayed within bamboo
Location: the current location of the artifact. As nothing is specified it means it is in the current working directory (there it has been created with the previous script)
Copy pattern: a expression that describes the file you want in this case any .txt file would be copied. You can enter the whole filename here too.
Shared: if this is checked other plans in bamboo can get this artifact too. Unchecked only the current Plan can get the artifact.
If you created the artifact at another direction you need to tell bamboo in the location field like I explained in my previous comment.
I hope this will help you out. 
Otherwise keep asking.
Best regards
Marcel
TAGS
AUG Leaders

Atlassian Community Events