DevOps(Day-33) : Setting up Webhook
Webhook
Setting up Webhook
Automating Task-1 through Webhook
Task-2 : Configuring Task-1 using Docker-Compose
Let's make a beautiful CI/CD Pipeline for your Node JS Application.
Webhook
Let's automate the build process with the integration of webhook in GitHub.
GitHub webhooks give developers the ability to integrate with the GitHub platform.
Developers can subscribe to events taking place on GitHub, for example, Push events that occur when code is pushed to a repository, and respond to the event with an action.
The response action can be anything, such as making a database entry in an external application, sending an email, triggering a deployment process, and more. Actions you can perform in response to events on GitHub are only limited by your imagination.
When a subscribed event occurs on GitHub, GitHub triggers an HTTP POST request to the defined destination. This destination is specified as an HTTP URL, which is the endpoint that is to be called whenever the event occurs. This is known as the webhook URL. The endpoint handler at the webhook URL handles the action to be performed in response to the event.
Setting up Webhook
You need to have ssh_key from the server and save it in GitHub.
Go to the code repository and navigate to the settings. Then provide the details in Webhook section.
The payload URL is the Jenkins URL.
It should be configured now.
Automating Task-1 through Webhook
Make changes to the file in GitHub for the project and commit it.
Monitor the build in Jenkins that must have triggered automatically by webhook.
Navigate to the URL to see the changes that you had made in the code in GitHub.
Task-2 : Configuring Task-1 using Docker-Compose
Write a Docker Compose file for the application.
Now, go to Jenkins and navigate to the build steps of the project.
Now, build the project and check if the build is successfully completed. Finally navigate to the URL.
Thanks for reading my article. Have a nice day.
Comments
Post a Comment