Find an rpm artifact
Asked by Bryan Andrews:

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:59 | Wrote: /home/jira/rpmbuild/RPMS/noarch/project-1.3.3-1.noarch.rpm      |
| 09-Apr-2015 19:09:59 | Executing(%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:59 | Unable 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?


Answers:
author: Bryan Andrews
body: 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. 
```


author: Alexey Chystoprudov
body: try to use Ant pattern to copy rpm resource from all folders: \*\*/\*.rpm


author: Bryan Andrews
body: ```
10-Apr-2015 08:59:22looking at /home/jira/rpmbuild/RPMS/noarch10-Apr-2015 08:59:22total 12K10-Apr-2015 08:59:22drwxr-xr-x. 2 jira jira   43 Apr 10 08:59 .10-Apr-2015 08:59:22drwxr-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.rpm10-Apr-2015 08:59:22looing at home10-Apr-2015 08:59:22total 32K10-Apr-2015 08:59:22drwx------. 6 jira jira 4.0K Apr 10 08:53 .10-Apr-2015 08:59:22drwxr-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_history10-Apr-2015 08:59:22-rw-r--r--. 1 jira jira   18 Sep 25  2014 .bash_logout10-Apr-2015 08:59:22-rw-r--r--. 1 jira jira  193 Sep 25  2014 .bash_profile10-Apr-2015 08:59:22-rw-r--r--. 1 jira jira  231 Sep 25  2014 .bashrc10-Apr-2015 08:59:22drwxr-xr-x. 3 jira jira   18 Mar 13 23:01 .java10-Apr-2015 08:59:22drwxr-----. 3 jira jira   18 Apr  9 18:54 .pki10-Apr-2015 08:59:22drwxr-xr-x. 8 jira jira   83 Apr  9 19:00 rpmbuild10-Apr-2015 08:59:22drwx------. 2 jira jira    6 Mar 13 22:41 .ssh10-Apr-2015 08:59:22-rw-r--r--. 1 jira jira 8.7K Apr 10 08:59 project-1.3.3-1.noarch.rpm10-Apr-2015 08:59:22Unable 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.


author: Alexey Chystoprudov
body: 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