Jenkins CI/CD Project with GitHub Integration using GitHub Webhook

Jenkins CI/CD Project with GitHub Integration using GitHub Webhook

An AWS instance is created and Jenkins is installed on that server. On the AWS management console, in the security section, the security group permissions are accessed and port 8080 (the port in which the Jenkins server runs) is given anywhere or private IPv4 access using inbound rules.

The server's private IP is then used to access port 8080. When the Jenkins dashboard appears, we must make sure to install the GitHub Integration plugin.

A new job is created as a Pipeline project of deployment. A suitable description is written, the project URL from the GitHub, the repository URL is added and the branch name is also specified. The GitHub hook trigger for GITScm polling is selected as the build trigger.

docker-compose down 
docker-compose up -d

The following code is used for running the container of the todo-app this code is written in the Execute Shell and changes are applied.

In the project GitHub repo settings, webhook options are selected and a new webhook is added. A URL is added in the following format

http://<private -ip>:8080//github-webhook/

The content type is selected as application/json and it is saved.

The purpose of webhook is that every time a new pipeline is created the Jenkins server hits the repo so that any change in the code is also reflected in the creation of the pipeline and running of the application.