DevOps Automation 2

  1. JOB1: Pull the GitHub repo automatically when some developer commits.
  2. JOB2: By looking at the code or program file, Jenkins should automatically start the respective language interpreter install image container to deploy code ( eg. If code is of PHP, then Jenkins should start the container that has PHP already installed)
  3. JOB3: Test your application if it is working or not.
  4. JOB4: If the application is not working, then send an email to the developer with an error message and if it is running file send a success message.
  5. JOB5: To monitor the container where the application is hosted, fails due to any reason then this job will automatically start the container again.
  1. Dockerfile for Jenkins image
  • I’ve passed -y option in every command to ignore user prompt while downloading.
  • The final output of all images after build —
Jenkins_task, html_img, and php_img are dockerfile created and Jenkins service is also started automatically
Here, an already running container of HTML of PHP will stop and code will be copied in the folder named data_folder.
Job1 success and job 2 triggered
  • >This job is chained to job1. So, it’ll automatically run just after a successful build of job1.
Job1 pulled HTML data, so a docker container for HTML is launched
  • >Also, Jenkins mail plugin can be used to send customized mail notification.
Configure Jenkins as a mail client. Jenkins will contact the google SMTP server.
  • Add POST BUILD ACTION and select MAIL NOTIFICATION and add the recipient mail address.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store