Run the fail chain when a job gets canceled?
![]()
BF 7.1.2
I have a long running job that on its way gathers some data and at the end emails it. Every so often there is a valid reason to cancel it. I'd still like to "summarize" the data gathered so far and preferably send the email. Is there any way to run the fail chain when a project gets canceled? |
Accepted answer
One other answer
![]()
You can accomplish this through a class entry chain.
Look in the class section, and you'll see that you can define a project to run on entry and on exit. What this means, is that when you change the class of a completed job, it will spawn a chain build of the specified project that inherits the environment of the project whose class you just changed.
Example: Your long running project has gathered most of it's data, and you needed to cancel it. After canceling the job, you can change it's class from the job page and the chained project would then interrogate the environment of the parent job to get the information it needs to email to you. For this to work nicely, you either need to store all of the information in environment variables or store a pointer to the information in an environment variable. In this case, I would choose the latter solution, and likely store a path to a file in a variable that I would access and email after.
This feature is closely related to purge chains that start when a build is purged (perhaps to clean up artifacts that the BF DB might not know about) and is configured in the same place.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.