project-01

Table of contents

No heading

No headings in the article.

Build CI / CD Pipeline using Jenkins and deploy the real world Web Application in AWS Cloud

Goals: CI/CD Pipelines will help you learn server automation, continuous integration, building pipelines, configuration of tools, automated testing, code quality improvement, and distributed systems in Jenkins through intensive, handson practical assignments.

Technologies Used:-

  1. Jenkins

  2. Groovy

  3. AWS Cloud

  4. Git

  5. Docker

Steps:

  1. Create jenkins file using our in-house code repo [should be cloned from git/bitbucket]

  2. Create Docker file in the same repository

  3. Build-Docker image with tagging as build version, unit test cases should pass if any for the code

  4. The Image should be available in ECR with build version as TAG

  5. The Docker Image should be deployed to EC2 Machine

  6. The EC2 Machine Need to open specific Inbound Port and restrict Access only for admin user to login

  7. Jenkins Jobs should do validation and display successful message

  8. Report should be sent to e-mail and it should contain status of each JOB

Creating Two instances one for Jenkin master and one for deploying.

git log histroy

Github repo

In jenkins create job .

  • Paste the url of github in git and github project blank

  • restict the project to run in particular node

Github integerate with jenkins and and click right to github hook trigger for GITSCM polling for the automatic build if any changes made commit to the github

in Build step take excute shell and add the following command to to run the container.

sudo docker rm -f $(sudo docker ps -a -q)
sudo docker build /home/ubuntu/jenkins/workspace/project01 -t website
sudo docker run -it -d --name c1 -p 80:80 website

In post-build action take the Email Notification put your recepctive email.

The build result

Email result which was sent by jenkis

Running website