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. 

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.

  1. You need to have ssh_key from the server and save it in GitHub.

  2. Go to the code repository and navigate to the settings. Then provide the details in Webhook section.

    The payload URL is the Jenkins URL.

  3. It should be configured now.

    1. Make changes to the file in GitHub for the project and commit it.

    2. Monitor the build in Jenkins that must have triggered automatically by webhook.

    3. Navigate to the URL to see the changes that you had made in the code in GitHub.

  1. Write a Docker Compose file for the application.

  2. Now, go to Jenkins and navigate to the build steps of the project.

  3. 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

Popular posts from this blog

DevOps(Day-97): Meta-Arguments in Terraform

DevOps(Day-95): Auto Scaling with Terraform

DevOps (Day-1) Introduction