Home > Enterprise >  CI/CD with Jenkins
CI/CD with Jenkins

Time:02-23

I just started to learn CI/CD with Jenkins.

Currently, I am very confused about the process with CI, and I'm not sure my understanding is correct or not.

Below is my understanding:

Coding in my local -> push the changes to GitHub with git -> pull the code from Github and build project with Jenkins

My other question is, is it every time I need to click build now in Jenkins manually, or it will automate build again after I make a change?

CodePudding user response:

For the first question you need to integrate Jenkins with build tools like Ant in the CI/CD pipeline to build the code after pull the code from Github.

For the second question gothrough the link automate the build it may helpful.

CodePudding user response:

Your understanding is correct and also, you can have Unit Testing stage before build project.

To build a project using Jenkins, you need not have to run the Jenkins pipeline manually everytime. You can make use of Webhooks in Github to automatically trigger the Jenkins pipeline on every commit or push or various other scenarios.

Here is the guide to help you understand more: https://docs.github.com/en/developers/webhooks-and-events/webhooks/about-webhooks

A simple tutorial on webhooks: https://www.blazemeter.com/blog/how-to-integrate-your-github-repository-to-your-jenkins-project

Some other ways:

You can also make use of the options available in Build Trigger sections which is available in your pipeline settings to build the Jenkins pipeline automatically.

Options:

  • Trigger builds remotely (e.g., from scripts)
  • Build after other projects are built
  • Build periodically
  • Build when a change is pushed to GitLab. GitLab webhook URL: https://<github_url> (Webhook)
  • GitHub hook trigger for GITScm polling
  • Poll SCM
  • Related