In this article, we are going to look at how we can automatically
execute our Jenkins Job just by receiving an email in our mailbox this
functionality is very much useful where we wanted to execute our build on
remote machine or server where we don’t have any direct access to it.
Just imagine you are seating at your home or some restaurant and
directly triggering your Jenkins build by just sending one email notification.
For this purpose, we need to use Poll Mailbox Trigger Plugin.
To know more about this plugin please click on this link.
The poll-mailbox-trigger is
a Jenkins "build trigger" plugin, which allows a Job to poll an email
inbox. When an unread email is found, that matches the configured criteria, it:
1.
marks the
email as read, so that it is not reprocessed
2.
triggers a new
job
To Setup Poll
Mailbox plugin, we need to follow steps
1)
Go to Jenkinsร Manage Jenkinsร Manage Pluginร Install Poll Mailbox Plugin.
2)
Now click on
New item and Create New Jenkins Job.
3)
Under Build
Trigger Section. Select the option of Poll Mailbox Trigger.
4)
Here we need
to provide the details for the host, username, and password.
Few Sample
Configurations are
5)
After this
Click on Test Connection and validate your settings.
6) Click on Apply
and Save Options.
7) Now whenever we receive mail
in our inbox which contains subject as Jenkins Build Trigger, it will
automatically trigger our Jenkins job.
Hi,
ReplyThanks for the Article.Its Really Useful.I followed the same steps in free style project it was worked for me.But when i followed the same step i cant trigger build in pipeline project.Can you help me if possible.
Thanks...
Can you help me how to download email attachments in Jenkins using the poll mailbox plugin
Reply