Setting Jenkins Job for Beginners - Part 6 (Last)

Setting Jenkins Job - Understanding Post Build Action

In the last post, we covered the Build section, where we can trigger multiple Jenkins jobs or execute different commands on either windows or shell. You can revisit the post here. Setting Jenkins Job - Understanding Build

In this post, we will cover the Post build actions like 
  • Publish Html Reports
  • Allure report, 
  • Executing set of scripts, 
  • Archive the artifacts,
  • Email Notification and 
  • Editable Email Notification.

Publish HTML Reports


This plugin allows the Jenkins jobs to publish certain reports or html files which can be used for the developer or other Jenkins jobs in the pipeline.

Allure Report


The allure plugin will help display the reports for the automation test cases. Once the automation test execution is done, it will generate the reports in either html or xml format. We can put these reports into the folder and put the folder path in the above textbox. This will generate the allure report for that Pipeline.  

Executing a set of scripts


As part of the post build actions, you can run a set of scripts. Those scripts can be attached here as part of batch or shell script file, groovy  scripts, or Build step as we saw it in the Build section. This step is useful to clear directories, or run environment specific commands.

Archive the artifacts


You can archive the artifacts which can be downloaded from the Jenkins build summary page. Give the path to the files that needs to be archived. You can exclude certain files from archiving if given in the advance section.

Email Notification


There are two kinds of email notification plugin. The basic one is this where you will add the recipients email address to notify about this build.

Editable Email Notification

In this plugin, you can edit the email content and can include files. The content-type can be changed to HTML (text/html) to get the file content in the emails. 

Here, we can send email to the list of developers or recipients list. This can be found in advance settings.
 
You can attach build logs as well, but sometimes the build logs becomes huge and can create an issue in sending the emails. So, better avoid adding the logs.

For any attachments, you can include like below:

Check the pattern, because Jenkins follow the apache ant version to identify files.

There are pre and post send scripts as well, which can be added to send emails.

This concludes the tutorial on creating or setting up a new Jenkins job.

Comments