Skip to content

Demonstrates how we can automate code build, run and commit in real time using docker, jenkins, webhook & aws ec2

Notifications You must be signed in to change notification settings

Kirthik1104/todo-node-app

Repository files navigation

Created CI/CD pipeline for Nodejs web application, using docker, jenkins, AWS EC2 & webhooks

In this project, we will learn about DevOps and DevSecOps tools in one project:

Tools Covered:

  • Linux
  • Git and GitHub
  • Docker
  • Docker-compose
  • Jenkins CI/CD using web hooks

Pre-requisites to implement this project:

  • AWS EC2 instance (Ubuntu) with instance type t2.large or micro and root volume 29GB.

  • Jenkins installed

  • Docker installled

    sudo apt-get update
    sudo apt-get install docker.io

Steps for Jenkins CI/CD:

  1. Access Jenkins UI and setup Jenkins alt text

  2. Enabled handshake between jenkins and github and generating ssh key-gen

    • Associating private key with jenkins
    • Associaating public key with github

    Note when you build the application in jenkins, it pulls your repo and and creates a dumps in jenkins. Check below image alt text

    Add jenkins as a user inside docker group to allow jenkins to interact, build and run docker containers.

      sudo -a -G docker jenkins

Ways to run your application:

  1. Using docker
 sudo docker build . -t <image-name>
 sudo docker run -d -p 8000:8000 <image-name (same as above)>

Note you can access the application using host ip:host port

  1. Using build steps in jenkins
run the above commands as build steps, so that you can run the application directly from jenkins build and not having to run the docker build and run manually. Check the below image

alt text

  1. Finally!! --> Automate the CI/CD pipeline and deploy the web application using webhooks, orchestrating docker build and run using commit trigger in jenkins. Check the below imaage for integration alt text Adding the jenkins-url followed by /github-webhook/ alt text Enabling build trigger which will then trigger build steps on code commit to start the automatic CI/CD pipeline.

-Now make update to the js file and commit the changes and see the magic happen! alt text alt text

-4)Security groups for my application alt text

nodejs todo application alt text

About

Demonstrates how we can automate code build, run and commit in real time using docker, jenkins, webhook & aws ec2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published