Table of contents
Let’s make a beautiful CI/CD Pipeline for your Node JS Application 😍
💼Task: 1
Fork repository
Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.
Webhooks provide a way for notifications to be delivered to an external web server whenever certain actions occur on a repository or organization.
For GitHub-Webhook:
Open the GitHub repository.
Go to “settings” and then to “hooks”.
Click the “Add webhook” button. Enter “<Jenkins url>//github-webhook/” Payload URL. Click on Add webhook.
💼Task: 2
In the Execute shell run the application using Docker compose
You will have to make a Docker Compose file for this Project
Run the project
Steps:
For the GitHub integration plugin
Click on Manage Jenkins >Manage plugin > Available plugin> GitHub integration > Install it
Create ssh public and private keys
Go to GitHub account > Account Settings >SSH and GPG keys>Enter public ip and add it
Click on New Item on left panel >Enter item name and select freestyle project options >click on Ok
Enter description > select checkbox Github project > enter github url of project
- In Source Code Management > select Git > enter github url> In credentials click on Add
- Select Github hook trigger for GITScm polling in Build trigger
- In build steps >select Execute shell > Enter commands of docker compose and save the configuration
echo "……Devops CI/CD Started………………"
docker-compose up -d
- Check the web-hook connection of the Github project, it should have a green checkmark.
Access the URL
Now make changes in code push to GitHub Master branch & jenkins will automatically build the code
📍 Conclusion :
In this blog, we cover how we can make a CI/CD pipeline Jenkins with the help of webhooks In the next blog, we will cover some advanced topics.
Thank you for reading!
Contact me on Linkedin 🤝
Check out my GitHub for more resources 📚