Node app Deployment using Jenkins Agent

Passionate ORACLE DATABASE ADMINISTRATOR | DevOps Enthusiast with a strong background in cloud architecture and solutions engineering.
First, we will setup Jenkins Agent
To setup an agent, the Master and Agent nodes must connected using SSH.
We need to add the Master node's public key into the Agent node's authorized keys.
On Master node...
go to /home/ubuntu/.ssh

select .pub key

copy it into Agent's node /home/ubuntu/.ssh/authorized_keys

Go to Jenkins console...
Go to Manage Jenkins/Nodes

Add New Node

Create Node

Do settings as below...


How to add Jenkins Credentials...
Go to Manage Jenkins/ Credentials
Provide the Master node's Private key

Currently showing Agent is offline

Try to launch agent...

Authentication is successful but gives java error

Need to install Java on Agent Node
Make sure the Master & Agent node's Java is of same version
After installing Java on the Agent instance, the Agent -node started working fine

Let's start with Node to-do App Deployment...
Copy code from the below Github repository
https://github.com/rushikesh-rawool10/node-todo-cicd.git

Mention the Agent name as below
pipeline {
agent {label 'Dev-Agent'}
Before deploying your code make sure of the following points:
Docker and docker-compose should be installed on your machine.
Your Jenkins user should be added to the docker group.
port 8000 (the port on which app will run)should be open from the ec2 instance.
For a detailed explanation of Jenkins declarative pipeline, the webhook trigger, and Jenkins deployment, check another blog on below link:
Running on node Dev-Agent successfully...

Using webhook trigger, Jenkins-Agent, and Jenkins automatic deployment, Our Node todo app is running fine...!



