Skip to content

Vickeysaini/Real-time-NODE.js-App-deployment-with-Jenkins-CI-CD-pipeline-Github-auto-trigger-webhook-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-time NODE.js App deployment with Jenkins CI CD pipeline|Github auto trigger webhook


   
Objective - Deploy end-to-end application in node.js using Jenkins CICD with GitHub Integration
- Trigger Jenkins pipeline automatically once the code is pushed on GitHub
Approach - Using Amazon's Elastic Compute Cloud (EC2) for running application on the Amazon Web Services (AWS) infrastructure
- Containerize application by creating Dockerfile
- Integrate GitHub with Jenkins using Webhook
Impact - Jenkins pipeline triggers automatically once the code is pushed on GitHub
- Accomplish faster quality releases by automating CI/CD pipelines

Primary Technology: Github, Docker, Jenkins, aws EC2 service

Design Thinking Whiteboard in Yellow Blue Basic Style



1. Creating a Node App

Before we write any CI/CD pipeline we need an application to test and deploy. We are going to build a simple to-do application in node.js. Then, create new repository under your GitHub account and name it “node-todo-cicd”. 1

2. Creating AWS EC2 instance

2.1 Creating AWS EC2 instance

After logging into your AWS account, search for EC2 2

Select Instances(running) 3

Click Launch instances 4

Enter Name and select Ubuntu 5

Select t2.micro as Instance type and create new key pair to connect to the server 6

Enter key pair name and select RSA as Key pair type and .pem as Private key file format. Then, click Create key pair 7 R

Step 1: Install NodeJS and NPM using nvm

Install node version manager (nvm) by typing the following at the command line.

sudo su -
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash

Activate nvm by typing the following at the command line.

. ~/.nvm/nvm.sh

Use nvm to install the latest version of Node.js by typing the following at the command line.

nvm install node

Test that node and npm are installed and running correctly by typing the following at the terminal:

node -v
npm -v

Step 2: Install Git and clone repository from GitHub

To install git, run below commands in the terminal window:

sudo apt-get update -y
sudo apt-get install git -y

Just to verify if system has git installed or not, please run below command in terminal:

git — version

This command will print the git version in the terminal.

Run below command to clone the code repository from Github:

Git Clone : https://github.com/Aseemakram19/nodejs-on-ec2-youtube.git
Branch Master.

Get inside the directory and Install Packages

cd nodejs-on-ec2
npm install

Start the application To start the application, run the below command in the terminal:

npm start

About

Real-time NODE.js App deployment with Jenkins CI CD pipeline|Github auto trigger webhook

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published