Wednesday 2 March 2016

Part 2 -- Jenkins most frequent tasks: Archive artifacts

An artifact in the Jenkins sense is the result of a build - the intended output of the build process. 
Here is how, you can archive the artifacts.
  1. We have a very simple script in our job, who produces some logs in "logs" directory.
    #!/bin/bash
    mkdir -p ${WORKSPACE}/logs
    echo "...I AM ALIVE.... You set my heart on fire."
    echo "Yes. I am definitely alive" > ${WORKSPACE}/logs/abc.txt
  2. Go to job configuration and add post-build action like below
  3. On next run of a job, you can see the artifacts given as a link
Note: It doesn't matter on which client it was built it will be tranfered from the workspace back to the master (server) and stored there with a link to the build. In my case, it is saved on Jenkins master at location /jobs/smoke/builds/48/archive/logs/abc.txt.

No comments:

Post a Comment