How to Archive an Artifact in Hudson

Posting Build Artifacts through Hudson can be a very useful tool.  I have worked on projects in the past where we posted test results, RPM files for clients to download and even text files that simply hold a revision number.

Archiving an Artifact via Hudson

It’s simple.

1. Go into your Hudson build and select Configure.

2. In the Post Build Actions section select the option entitled “Archive Artifacts”

3. List out the names of the files that you want to include.

Hudson Archiving Artifacts

Also – note that Hudson includes a tip for how you can include a batch of files from a folder location.  You can do that by including wildcards in your selection such as


Save custom data as an Archived Artifact in Hudson

Now lets suppose that you have a build rev or some other data that you want to spit out in a fashion that is easy for Release Managers to work with.  Hudson can easily do this using the archive artifacts feature.

1. During your job include a step that spits out the data you want to a simple text file.  If you need to, add an “Execute Shell” step in your Hudson job and then spit the variable out via a bash command such as

$ echo “some data” > tmp.txt

2. Then simply include the text file (tmp.txt if you used the echo example) as the file that you want to archive.

Now you have a custom artifact file being archived through hudson.  Nice work.

Posted in , and tagged .