Complete Jenkins CI/CD Project: #Day 24 Task
Let's make a beautiful CI/CD Pipeline for Node JS Application ๐
Task-01
I have forked the repository: https://github.com/Namg04/node-todo-cicd for "node-todo-cicd" project
Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.
Select "GitHub hook trigger for GITScm polling"
Add build steps
Configure GitHub Webhook:
Open your GitHub repository in your browser.
Go to the repository's "Settings" tab.
Select "Webhooks" from the left-hand menu.
Click on the "Add webhook" button.
In the "Payload URL" field, enter the Jenkins server URL.
For "Content type," choose "application/JSON."
Select the events that you want to trigger in the webhook. The most common event is "push," which triggers when code is pushed to the repository.
Click "Add webhook" to save the webhook configuration.
Refresh the page:
Save the configuration and there are no builds created as of now
To test the GitHub webhook let's make some changes in the GitHub repo and commit the changes.
As soon I committed the changes, the webhook sent a request to the Jenkins job's URL and it triggered the Jenkins job automatically to run specified build steps to deploy the node-todo-cicd-app.
Access your app through Jenkins URL
๐ฅBoom node-todo-cicd project has deployed successfully through WebHook๐ฅ
Task-02
In the Execute shell run the application using Docker compose
You will have to make a Docker Compose file for this Project (Can be a good open-source contribution)
Commit changes
Run the project and give yourself a treat:)
Thank you for reading. Happy Learning!!!๐