简体   繁体   中英

Jenkins Editable Email Notification post build action want to run per day once

I have configured my jenkins job with cron (every 1 hr) and in the post build action i have added 'Editable Email Notification' and trigger the same on Failure basis but i want the email to be sent at every night(say 1am/2am) for the last job status(want to run post build action-Editable Email Notification) . How we can achieve the same but with in the same job.

You can create a separate email job that runs nightly, and grabs all the statuses of the jobs you care about, and then only append notifications to the email text if that status is FAILURE or BACK TO NORMAL etc. Then send the email.

You can grab build statuses via curl commands and the Jenkins API.

The one small caveat is you need an actual jenkins user and API token to use this. You can easily make a bot user/NUID for this purpose.

Let me know if you need more details / code snippets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM