Jenkins - Access to build logs, artifacts, git-commit change logs of upstream builds

779 views Asked by At

Scenario:
I have 3 Jenkins jobs. JOB-A, JOB-B and JOB-C. IF JOB-A is a success, it fires up JOB-B and same way, if JOB-B is a success it starts JOB-C.

  • I have used extended email plugin which is configured to notify only if JOB-A or JOB-B fails and JOB-C is not triggered
  • If JOB-A and JOB-B are healthy no emails get triggered by them. So only the JOB-C triggers one email with status success

Problem:
In the case of all healthy scenario, JOB-A and JOB-B are not triggering any notification. So only JOB-C triggers a notification. I wanted to know - if JOB-C can access build artifacts, build logs, git commit change logs and status (which should be success) of JOB-A and JOB-B (upstream) and use them together with the extended email template. If so How ?

1

There are 1 answers

0
LeoN On

There is a simple solution for this. What you have to do is to use the copy artifact plugin and store the build artifacts, build log and the git commit changes as artifacts.

Git commit changes and build log can be store as text files and then be added to the artifacts.

JOB-C should have permission to access the JOB-As artifacts. This can be given as a build step when you set what to be copied as artifacts.

Following link is for copy artifact plugin.

https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin