# Day 24 Task: Complete Jenkins CI/CD Project

Let's create end to end CICD for project Node JS application.

### <mark>Task-01</mark>

**Fork** [**this**](https://github.com/LondheShubham153/node-todo-cicd.git) **repository:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691160433966/cd04cfdc-f6af-4bb0-9434-905f7d71f894.png align="center")

***<mark>Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.</mark>***

**Steps:**

Generate the SSH keys for integrating your Jenkins project with your git repository. Use ssh-keygen command to create public and private key.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691163516259/0141e985-91ba-4a8c-b3a8-1d9a73bd63f3.png align="center")

**<mark>Configuring GitHub</mark>**

<mark>1.Go to your GitHub account settings.</mark>

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691163967440/e292851e-0b42-4bdc-bd4b-40d2d1aa9aae.png align="center")

<mark>2.Go to </mark> **<mark>SSH and GPG keys</mark>**<mark>, Add public key that we created using ssh-keygen and select key-type Authentication key.</mark>

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691225042765/418c550b-a9ed-4432-9edb-0eb443dcdf73.png align="center")

**<mark>For GitHub-Webhook:</mark>**

* Go to your GitHub repository and click on **Settings**.
    
* Click on **Webhooks** and then click on **Add webhook**.
    
* In the ‘Payload URL’ field, paste your Jenkins environment URL. At the end of this URL add /github-webhook/. In the ‘Content type’ select: ‘application/json’ and leave the ‘Secret’ field empty.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691225519476/7e9dd937-4987-4bac-961f-ec1221389279.png align="center")

* Now for Installing GitHub Integration plugin in Jenkins
    
* Open your jenkins dashboard.
    
* Click on the Manage Jenkins button on your Jenkins dashboard
    
* Click on Manage Plugins
    
* Install GitHub Integration plugin.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691225818399/8166a4b5-23a7-4eba-b2ab-ac775078d562.png align="center")

* Configuring Jenkins:
    
* Create a jenkins job:
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691226078697/5eaea770-c0b5-468c-bb67-7f792dfa4224.png align="center")

* <mark>Create node-todo-app freestyle project:</mark>
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691226163289/af20d0c8-b97a-4368-a015-b1329262a4e1.png align="center")

* *<mark>In Configure, GitHub project URL write your project GitHub URL:</mark>*
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691226889391/6b586c3e-b928-487d-bccb-a6b4392be02e.png align="center")

* <mark>In Git, add credentials for Jenkins:</mark>
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691227497178/7a62996f-4beb-4028-9bbb-5c0b03d085de.png align="center")

* <mark>Click on the&nbsp;‘Build Triggers’&nbsp;tab and then on the&nbsp;‘GitHub hook trigger for GITScm polling’.</mark>
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691227563405/6b1619fd-7515-4ed0-b55d-ad0b08d08c2c.png align="center")

### **<mark>Task 2:</mark>**

**In the Execute shell run the application using Docker compose**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691227694557/25f0324e-8fa3-4f7d-88b2-0fb23d04e5c9.png align="center")

* You will have to make a Docker Compose file for this Project
    
* After build you can check console output.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691228029646/11011207-3da3-473d-b87e-3fd6d786cc90.png align="center")

* <mark>Using docker ps command, you can see container is created.</mark>
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691228183065/75fa2aae-5e92-4478-a385-3cd1ca7e5b01.png align="center")

* <mark>Browse public IP address with port no.8000</mark>
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691228312182/87d88be5-6721-4fa5-a674-89431d817701.png align="center")

Thankyou for reading. Happy Learning.
