0

I am having two interdependent jobs, so my purpose is to send email notification to commiter of job-A after the completion of job-B. For sending the notification i got a reply like i need to have fingerprinting between dependent jobs.

So my question is for fingerprinting, whether i needed to archive artifacts, i have finger print that artifacts or i can fingerprint whatever i file required for checking dependency between two jobs?

How can i send email notification on the basis of job-B(success/failure) to those who commit on job-A?

Please somebody explain it elaborately because I am new to jenkins.

Vivek Kumar Ray
  • 8,323
  • 5
  • 21
  • 28
varghese
  • 131
  • 1
  • 4
  • 12

1 Answers1

0

Yes you need to archive artifacts and fingerprint them in order to create a dependency chain between your jobs. That way Job A build #256 with a fingerprinted item "some.file" will be linked to Job B build #1623 with the same fingerprint id of item "some.file".

In order to send email notifications when Job B fails you need to setup promoted builds. Promoted builds allow you to define an action when a downstream project succeeds, breaks, fails, etc.. For example by sending an E-mail.

Arnestig
  • 2,285
  • 18
  • 30
  • Archive artifacts means archive my build folder completely in both JOB A AND B Also fingerprint these archive in both A and B.? – varghese Jul 19 '12 at 10:51
  • You only need to archive and fingerprint one file that is being used in both jobs. Doesnt have to be the entire directory, just one file that is being used. Preferably binaries built in job A that is copied to job B or source files that have the same fingerprint. – Arnestig Jul 19 '12 at 11:23
  • From you point what i understand, i have a text file which is in both job A and job B, it won't change at any time. So i can use this for archieve and fingerprint in job A and B. I can take fingerprint of both in job A and B. My doubt is whether any copying artifact is needed? How can connect this to notifying the commiter of first job from second job? commiter is possible through promotion build(success/fail)? – varghese Jul 19 '12 at 12:03
  • If you have a file that is really used in both job A and B then you don't need to copy it. I copy my artifacts since it's something I produce in job A (a binary to be tested in job B). Then as I said you need to use promoted builds in job A to say that "if downstream job B fails, then send email notification to..." – Arnestig Jul 19 '12 at 12:06
  • I have taken a file common in both job A and job B. Artifacts got created. When i click check fingerprint, it's showing like Got a jar file but don't know which version it is? Find that out by checking the fingerprint against the database in Jenkins (more details). Fingerprint folder and an xml is created in my master system? How to solve this error? – varghese Jul 19 '12 at 15:50
  • Don't click any check fingerprint buttons. Have you specified which files you want to fingerprint? you do that in your job setup... – Arnestig Jul 19 '12 at 16:21
  • No, i clicked only fingerprint all artifacts. Files to finger print i have to give as those archived files as you mentioned?..it's in my master system how can give files to fingerprint as my archived artifacts on my master system..My master is ubuntu and slave is windows. This is what i understood?..Provide me a solution please? – varghese Jul 20 '12 at 05:40
  • Inside the job you have an option calld **Record fingerprints of files to track usage**. Here you need to specify a file which is used in both job A and job B. You need to do this on both jobs as well. This will tie the two jobs together by having the same file fingerprinted. – Arnestig Jul 20 '12 at 05:45
  • Thanks for your reply...See, i feel like dumb, Since i am not getting why we need artifacts for fingerprinting, Why copying artifacts is needed, whether artifacts for only storing or any other purpose, artifacts means only build output or any file?..Can you suggest me some link or points for it?.. – varghese Jul 20 '12 at 08:02
  • Let's say you have a file (myexample.txt). It has this fingerprint: 625a047393435168197d8520e71b2b26. In Job A you configure jenkins to record that file's fingerprint for later use. In Job B you have the exact same file (myexample.txt). It has the exact same fingerprint. Now since you will also check the fingerprint in Job B for that file Jenkins knows that build #512 in Job A had a fingerprint 625a047393435168197d8520e71b2b26 which was then later also recorded in build #8128 of Job B. That way Jenkins can tie these two builds together using these two fingerprints. – Arnestig Jul 20 '12 at 08:08
  • I got finger prints on two jobs, but when i click project relationship, put upstream and downstream, it is saying no finger print matches found between jobs. What is it? I checked the fingerprint md5 sum both are same in two jobs..Then how is it not recognizing? – varghese Jul 21 '12 at 06:27
  • Sounds wierd then.. Normally you can click the icon next to the archived artifact from your job.. that should display what other jobs those files are tied to.. Have you checked that? – Arnestig Jul 21 '12 at 07:32
  • I checked that..it's showing no fingerprint dependencies found. When i gone through job wise it is displaying file,orginal owner, age..Here orginal owner is outside jenkins..Could it be a reason for no fingerprint? – varghese Jul 21 '12 at 09:23
  • one more point to add, when i click icon under Usage its showing my two jobs and build number of two job(means both are dependent)..but not showing in project dependencies.. – varghese Jul 21 '12 at 09:57