Building a Small Jenkins Project with Email Notifications and Remote Job Execution

Dheeren GaudDheeren Gaud
2 min read

I recently created a small Jenkins project to explore two very useful features:

  1. Automated Email Notifications – to get alerts on build status.

  2. Remote Shell Execution – to transfer and run scripts on another server.


1. Automated Email Notifications

I set up Jenkins to send an email after every build — whether it passed or failed.

Steps:

  • Installed the Email Extension Plugin.

  • Configured SMTP details under Manage Jenkins → Configure System (I used Gmail SMTP for testing).

  • Added Editable Email Notification in Post-build Actions.

  • Customized the subject and message to include build results.

  • Ran a sample build to verify — I instantly received the build status in my inbox.

Email config in Jenkins Manager

Adding post build action in job

Outcome:

The team gets real-time build updates without checking the Jenkins dashboard.


2. Remote Shell Execution via Jenkins

I wanted Jenkins to automatically transfer a shell script to a remote server and execute it, creating a testfile in /tmp.

Steps I followed:

  1. Generated SSH keys on the Jenkins server and copied the public key to the remote server’s ~/.ssh/authorized_keys.

  2. Installed the Publish Over SSH plugin in Jenkins.

  3. Configured the remote server in Manage Jenkins → Configure System:

    • Added the IP address.

    • Specified the SSH key for authentication.

  4. Created a Jenkins job and selected Build Step → Send files or execute commands over SSH.

  5. Added the source file path (the shell script) and specified the remote execution command.

  6. Clicked Build — Jenkins transferred the script and executed it.

  7. Verified that the testfile was successfully created in /tmp on the remote server.

Added key and ip i n Manage jenkins

Job

Remote server (successfully executed shell code)

Outcome:
This approach allows automated deployments, remote server configurations, and test runs without manual SSH login.


Conclusion

This small project gave me hands-on experience with:

  • Automated notifications for better communication.

  • Remote job execution for seamless integration between Jenkins and external servers.

Even simple setups like this can save time and make CI/CD workflows more powerful.

0
Subscribe to my newsletter

Read articles from Dheeren Gaud directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Dheeren Gaud
Dheeren Gaud

Hi, I'm Dheeren — currently pursuing my Bachelor's degree in Information Technology from Father Agnel College (FCRIT). I have a deep interest in web development, especially in the MERN stack, and have worked on several projects including MY-docs, Predictive Maintenance systems, a WhatsApp clone, and custom chatbot applications. Over time, I’ve developed strong skills in Java, data structures, and algorithms, and I’m always excited to solve complex problems through technology. Recently, I’ve become very interested in DevOps and am actively learning tools and technologies like Docker, Kubernetes, CI/CD pipelines, and cloud platforms to enhance my development and deployment workflows. I’ve also participated in national-level hackathons such as SIH, Terna, Kongsberg Maritime, and NIT Jalandhar, and was fortunate to achieve recognition in some of them. These experiences have helped shape my collaborative, problem-solving, and quick-learning mindset. Always open to learning, collaborating, and building impactful solutions!