# Day 24 Task: Complete Jenkins CI/CD Project.

***DevOps Engineers in the today article, We will learn Practical of Jenkins project with the help NodeJS Application, Now let us discuss with the help of Task.***

### **Task-01**

***Fork create a repository on GitHub account, repository name node-todo-cicd. I will use and click on the create repository button.***

### **Task-01**

***Fork create a repository on GitHub account, repository name node-todo-cicd. I will use and click on the create repository button.***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQHc-derF0bJzw/article-inline_image-shrink_1000_1488/0/1683102778664?e=2147483647&v=beta&t=ZZYe2iAC-G2ZyiwJqawLDyYrvEO5Wn8hOTH8KUB-oXc align="left")

repository on GitHub account, repository name node-todo-cicd. Diagram.

***Now Create a Connection to your Jenkins with the GitHub integration with the help of SSH key. Process will be mentioned here:-***

***Syntax:- ssh-keygen***

***cd .ssh ; cat id\_***[***rsa.pub***](http://rsa.pub) ***(it will show the ssh key of your system linux, Ec2 instance which environment you will be used)***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQE5xlikOJJ9xw/article-inline_image-shrink_400_744/0/1683103435847?e=2147483647&v=beta&t=7EuBPwOgXbQhPcMp0FxP2FVIjjtmWnxTn2t80TnJQb4 align="left")

cat id\_[rsa.pub](http://rsa.pub) file Digram.

***Configure the SSH-Key in your GitHub account Settings***

***Click on the Profile button&gt;go to the settings &gt; on the left side ssh and GPG keys add a new ssh key and provide Tittle with following key.***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQGXw3k6JZ2ghA/article-inline_image-shrink_1000_1488/0/1683103709481?e=2147483647&v=beta&t=kyQGLf18w-kUISUdIt3mCvoD0Uyy_DsFq-uCchvlHqo align="left")

Click on the settings button Digram,

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQFQKSdNVi_7xQ/article-inline_image-shrink_400_744/0/1683103841596?e=2147483647&v=beta&t=U_VfJJpvGETPSgYZwaM0kj4zp-6CJ0nb7TUyYNss3zY align="left")

Added SSH-Key in your GitHub account Diagram.

***For GitHub-Webhook:***

***A) Go to your GitHub repository and click on Settings.***

***B) Click on Webhooks and then click on Add webhook.***

***C) In the Left side contents and Automation select the weebhook option. Now click on add option.Payload URL enter the Jenkins url with its port no:***

***Syntax:*** [***https://ip:8080/github-web***](https://ip:8080/github-web)

***D) In the content type select the application/json.***

***E) Click on Add webhhok.***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQGbf4PtMrvQnQ/article-inline_image-shrink_400_744/0/1683134166672?e=2147483647&v=beta&t=RPdraSZSg96L1tO_v9orCvSBtNOEOi0DssueenpuPvo align="left")

Webhook option in Github Diagram.

***Now next step is the install Plugins in Jenkins***

1. ***Open the Jenkins Dashboard.***
    
2. ***Click on Manage-Jenkins button on your Jenkins dashboard.***
    
3. ***In the System configuration, Click on Manage Plugins.***
    
4. ***Install the GitHub integration Plugin.***
    
5. ***In the Ava liable plugins option,search the GitHub integration.***
    

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQFF1yC_xcHIYQ/article-inline_image-shrink_400_744/0/1683134533509?e=2147483647&v=beta&t=TOOSr3JpC2LsMawidN3LtOQslYP87wePXqNUOr5rH9E align="left")

Git-Hub Integration install in avaliable plugins option Digram.

***Let's move forward:- Configuration of Jenkins:-***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQGv50VA2qrs5w/article-inline_image-shrink_400_744/0/1683134965705?e=2147483647&v=beta&t=mZQ1-BG_WCXhOXQHN56vNl7u3wZp3gtrqN7o7-EKzqE align="left")

Jenkins Configuration Page Diagram.

***2\. Click on the New Item.***

***3 Give a Name node-todo-cicd free style project, Click on the ok button.***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQEFiEp-0vgldQ/article-inline_image-shrink_400_744/0/1683135126007?e=2147483647&v=beta&t=2civ0J03Exko1NuXIS70Ggqn9k6K_s6qvt6VQf5igtg align="left")

Create a freestyle project Diagram.

***4 In the General option, Provide a description name,select the git-hub project and paste your git hub URL repository link.***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQGOayjjSAiDfQ/article-inline_image-shrink_400_744/0/1683135426618?e=2147483647&v=beta&t=WZh0fdpskNcMdludztAgdjkOJgBX9bUIKW35Vq7mwhs align="left")

Add a Github project link Diagram.

***5 In Source code Management add Repository url:-***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQECEBH9ebAF8w/article-inline_image-shrink_400_744/0/1683135585607?e=2147483647&v=beta&t=g5av90XslOKhLkZvWwaSN40GHjzoGk4mOfB8xYkTVbg align="left")

In Source code Management add Repository url:-

***6\. Credentials option click on add-and select the jenkins option.***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQFGWjafZ4jUDw/article-inline_image-shrink_400_744/0/1683135651673?e=2147483647&v=beta&t=QtmQLG_Tz_MQ-oKG41xqTPMPiU8YVSvaKAd9pdIp0DE align="left")

Add credentials of Jenkins Diagram.

[***7.Select***](http://7.Select) ***the ssh-keygen with username, provide a Ec2 instance username.***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQHaJECemlqsgA/article-inline_image-shrink_400_744/0/1683135952659?e=2147483647&v=beta&t=EjmNXFQbe-2seA7aMTODxfo-E52SpBENw9ijh4vwbbs align="left")

Add a Jenkins Credentials sshkeygen with username Diagram.

***8\. Click on the ‘Build Triggers’ tab and then on the ‘GitHub hook trigger for GITScm polling’. click on apply and save.***

![No alt text provided for this image](https://media.licdn.com/dms/image/D4D12AQHDlLUWNSb6hw/article-inline_image-shrink_400_744/0/1683136124977?e=2147483647&v=beta&t=wB92sxNlqGTuyhknfzfNDc9OhasPxkzJQRBzt91RdbM align="left")

trigger for GITScm polling’ Diagram.

### **Task-02**

* In the Execute shell run the application using Docker compose
    

![](https://media.licdn.com/dms/image/D4D12AQHywNLFNWDgfw/article-inline_image-shrink_1500_2232/0/1701062077124?e=1711584000&v=beta&t=BNRfDTJJ0s80nq-bdRQjnDcyMRkH3wu4oyGZDV9U0tI align="left")

* You will have to make a Docker Compose file for this Project
    

**NOTE : Install the docker compose on your server ( like for ubuntu - docker-compose install -y)**

* After build you can check console output.
    

![](https://media.licdn.com/dms/image/D4D12AQHD6gd3eENCxg/article-inline_image-shrink_1500_2232/0/1701062527328?e=1711584000&v=beta&t=_vM_ZEwVTDPXZxYuL1YNe4uYNwDFoBjd1aCYi3MpBrg align="left")

![](https://media.licdn.com/dms/image/D4D12AQHs7f8p71GD0g/article-inline_image-shrink_1500_2232/0/1701062647315?e=1711584000&v=beta&t=1_uyGmZBq9ZbS13QvOqCrq3USJxKLZ5GXDy5m8JSFJw align="left")

* You will have to make a Docker Compose file for this Project (Can be a good open source contribution)
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705943903416/0e188235-4be9-4508-9e36-2c1b52f748ea.png align="center")

* Run the project and give yourself a treat:)
