Complete Jenkins CI/CD Project

Complete Jenkins CI/CD Project

·

2 min read

Table of contents

Task 1:

  • Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.

For this, first, we need to create a Jenkins job. Follow the same steps that were done in the last blog.

Note: All the steps will be the same but make sure to enable GitHub SCM polling as shown in the below picture

Now, before establishing a connection we need to make sure that our Jenkins is ready to be connected to GitHub. For that, we have to install the plugin of GitHub integration.

You can restart your Jenkins after this. Now let's create a GitHub webhook.

  • Open your forked GitHub repository and go to settings.

  • In the Code and Automation section, there will be an option called Webhooks. Open it and click on Create a new Webhook.

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

The green tick indicates that the connection has been established.

Now go to your Jenkins and build your job. Open it in the relevant port.

It's time to see the actual automation and what we have been learning will be hands-on. As soon as you change your code of the project in the GitHub and commit it there will be a simultaneous new build.

For example, here I have made a change in h1 of the todo.ejs

The result can be seen here :


Task 2:

  • 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)

  • Run the project and give yourself a treat:)

Thank you for reading until here. This project has some challenges of its own. But it feels good after completing it. Hope it added some value. See you until next time.