Let's make a beautiful CI/CD Pipeline for your Node JS Application ๐
Day 23 was all about Jenkins CI/CD, make sure you have done it and understood the concepts. As of today You will be doing one Project End to End and adding it to your resume :)
As you have worked with Docker and Docker Compose, it will be good to use it in a live project.
Task-01 & 02
Fork this repository
Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.
Read About GitHub WebHooks and make sure you have a CICD setup
Refer to this video for the entire project
Steps to follow -
- Go to GitHub repository -> Settings of repository -> Webhooks -> Create a webhook -> Give the URL of your Jenkins host (IP:8080/github-webhook)
- Once connected, it should show a green tick as connected -
Now, we need to set up Github integration.
Create a new freestyle project
Give the github repo link
Go to Source code management -> Select Git and
Give repo URL
Setup credentials -
To set credentials, go to the Jenkins server and create secret keys using the ssh-keygen command
Copy the private key and go back to Jenkins UI
Click on Add credentials
Give username and private key and save it.
Select GitHub hook trigger under Build triggers
Set up build steps -
Build the job -
As we have set up the webhook, Jenkins should trigger the build as soon as there is any push request in the GitHub repository. To test, make a push request in GitHub by making any minor change in the code.
As we can see below screenshot, as soon as there was a commit in the GitHub repository, a build job was triggered by Webhook.
Thank you :)