Find an rpm artifact

I have a bamboo job that pulls a git repo and successfully builds an RPM. However I can't figure out how to get the bamboo job to recognize the RPM artifact correctly.

Here is the successful RPM creation via script:

09-Apr-2015 19:09:59Wrote: /home/jira/rpmbuild/RPMS/noarch/project-1.3.3-1.noarch.rpm
09-Apr-2015 19:09:59Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.mzy1wM
09-Apr-2015 19:09:59+ umask 022
09-Apr-2015 19:09:59+ cd /home/jira/rpmbuild/BUILD
09-Apr-2015 19:09:59+ cd project-1.3.3
09-Apr-2015 19:09:59+ /usr/bin/rm -rf /home/jira/rpmbuild/BUILDROOT/project-1.3.3-1.x86_64
09-Apr-2015 19:09:59+ exit 0
09-Apr-2015 19:09:59Unable to publish artifact [project RPM]: null

 

Here is the job artifact settings:

  • Location: /home/jira/rpmbuild/RPMS/noarch/
  • Copy Pattern: *.rpm 

 

Any idea what I'm doing wrong?

4 answers

1 accepted

I was able to resolve this by adding this line to the end of the build script:

 

cp project-*.rpm ${bamboo_build_working_directory}

 

The Bamboo plan artifacts section can only look in the 

${bamboo_build_working_directory} directory or relative to it. 
0 votes

Hello Bryan,

Can you add another Script task with "ls -l" command to see if your rpm file is exists at  /home/jira/rpmbuild/RPMS/noarch/ folder

10-Apr-2015 08:59:22
looking at /home/jira/rpmbuild/RPMS/noarch

10-Apr-2015 08:59:22
total 12K

10-Apr-2015 08:59:22
drwxr-xr-x. 2 jira jira   43 Apr 10 08:59 .

10-Apr-2015 08:59:22
drwxr-xr-x. 3 jira jira   19 Apr  9 19:00 ..

10-Apr-2015 08:59:22
-rw-r--r--. 1 jira jira 8.7K Apr 10 08:59 project-1.3.3-1.noarch.rpm

10-Apr-2015 08:59:22
looing at home

10-Apr-2015 08:59:22
total 32K

10-Apr-2015 08:59:22
drwx------. 6 jira jira 4.0K Apr 10 08:53 .

10-Apr-2015 08:59:22
drwxr-xr-x. 5 root root   41 Mar 13 14:36 ..

10-Apr-2015 08:59:22
-rw-------. 1 jira jira  162 Mar 13 22:33 .bash_history

10-Apr-2015 08:59:22
-rw-r--r--. 1 jira jira   18 Sep 25  2014 .bash_logout

10-Apr-2015 08:59:22
-rw-r--r--. 1 jira jira  193 Sep 25  2014 .bash_profile

10-Apr-2015 08:59:22
-rw-r--r--. 1 jira jira  231 Sep 25  2014 .bashrc

10-Apr-2015 08:59:22
drwxr-xr-x. 3 jira jira   18 Mar 13 23:01 .java

10-Apr-2015 08:59:22
drwxr-----. 3 jira jira   18 Apr  9 18:54 .pki

10-Apr-2015 08:59:22
drwxr-xr-x. 8 jira jira   83 Apr  9 19:00 rpmbuild

10-Apr-2015 08:59:22
drwx------. 2 jira jira    6 Mar 13 22:41 .ssh

10-Apr-2015 08:59:22
-rw-r--r--. 1 jira jira 8.7K Apr 10 08:59 project-1.3.3-1.noarch.rpm

10-Apr-2015 08:59:22
Unable to publish artifact [project RPM]: null

 

Good idea. I added a couple echo's and ls -lah commands to the script to confirm the files are there. Maybe I don't understand how the artifact page works. I was expecting to be able to tell it a path and wildcard like *.rpm to get all RPM files but that isn't working even thought in stage1 the RPM files is certainly there. 

0 votes

try to use Ant pattern to copy rpm resource from all folders: **/*.rpm

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,080 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot