Day 24 : Jenkins CI/CD Project

Day 24 : Jenkins CI/CD Project

Let’s make a beautiful CI/CD Pipeline for your Node JS Application

Task-01

  1. Fork this repository:

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

    Generate the SSH keys for integrating your Jenkins project with your git repository. Use ssh-keygen command to create public and private key.

    Configuring GitHub

    1. Go to your GitHub account settings.

    2. Go to "SSH and GPG" keys and click on "New SSH key", Add public key (i.e. id_rsa.pub) that we created using ssh-keygen and select key-type Authentication key.

GitHub-Webhook:

  1. Go to your GitHub repository and click on Settings.

  2. Click on Webhooks and then click on Add webhook.

  3. In the ‘Payload URL’ field, paste your Jenkins environment URL. At the end of this URL add /github-webhook/. In the ‘Content type’ select: ‘application/json’ and leave the ‘Secret’ field empty and click on "Add webhook".

Installing GitHub Integration plugin in Jenkins :

  1. Open your jenkins dashboard.

  2. Click on the Manage Jenkins button on your Jenkins dashboard.

  3. Click on Plugins->Available plugins.

  4. Install GitHub Integration plugin.

Configuring Jenkins :

  1. Click on "Create a job" to create a new project.

  2. Enter a name for your project (e.g., "node-todo-app").

  3. Select "Freestyle project" and click "OK" to create the project.

  4. In Configure, GitHub project URL write your project GitHub URL

  5. In Git, add credentials for jenkins

    Add private key which we created using ssh-keygen command.

  6. Click on the ‘Build Triggers’ tab and then on the ‘GitHub hook trigger for GITScm polling’.

Task-02

In the Execute shell run the application using Docker compose.

Click On Save.

You will have to make a Docker Compose file for this Project.

After build you can check console output.

Using docker ps command, you can see container is created.

Browse public IP address with port no.8000

Conclusion

Integrating Jenkins with GitHub via GitHub Integration simplifies your CI/CD workflows, enabling automated builds, streamlined deployments, and improved collaboration among development teams. By following the steps outlined in this blog post, you can create a seamless connection between your Jenkins jobs and GitHub repositories, enhancing productivity and software delivery efficiency. Embrace the power of automation and collaboration to accelerate your development processes and deliver high-quality software consistently.

I'm confident that this article will prove to be valuable, helping you discover new insights and learn something enriching .

thank you : )