Day 24 Task: Complete Jenkins CI/CD Project - 90DaysOfDevOps

Day 24 Task: Complete Jenkins CI/CD Project - 90DaysOfDevOps

ยท

2 min read

Let's make a beautiful CI/CD Pipeline for your Node JS Application ๐Ÿ˜

  • Day 23 was all about Jenkins CI/CD, make sure you have done it and understood the concepts. As of today You will be doing one Project End to End and adding it to your resume :)

  • As you have worked with Docker and Docker Compose, it will be good to use it in a live project.

Task-01 & 02

  1. Fork this repository

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

  • Read About GitHub WebHooks and make sure you have a CICD setup

  • Refer to this video for the entire project

Steps to follow -

  1. Go to GitHub repository -> Settings of repository -> Webhooks -> Create a webhook -> Give the URL of your Jenkins host (IP:8080/github-webhook)

  1. Once connected, it should show a green tick as connected -

  1. Now, we need to set up Github integration.

  2. Create a new freestyle project

  3. Give the github repo link

  4. Go to Source code management -> Select Git and

    • Give repo URL

    • Setup credentials -

      • To set credentials, go to the Jenkins server and create secret keys using the ssh-keygen command

        • Copy the private key and go back to Jenkins UI

        • Click on Add credentials

        • Give username and private key and save it.

  5. Select GitHub hook trigger under Build triggers

  6. Set up build steps -

  7. Build the job -

  8. As we have set up the webhook, Jenkins should trigger the build as soon as there is any push request in the GitHub repository. To test, make a push request in GitHub by making any minor change in the code.

  9. As we can see below screenshot, as soon as there was a commit in the GitHub repository, a build job was triggered by Webhook.

Thank you :)

ย