Imagine you have your git repository hosted on Gitlab, and want to automatically trigger a Jenkins pipeline to build your code when you push on a given branch, for example "develop".
Here are the steps to follow.
1) Download Gitlab plugin for Jenkins.
Project repository is here: https://github.com/jenkinsci/gitlab-plugin#webhook-url
2)Create a new pipeline on Jenkins.
In this example we named the pipeline "my-pipeline"
3) Set Jenkins Integration in Gitlab.
Go in your project repository, and configure the integration like here:
As you can see, the Secret token is the same shown on Jenkins Build Trigger.
4) Create a Jenkins user on Gitlab to clone the repository.
Create the user and then add it as a Developer in your project.
5) Create a Credential set for Jenkins user on Jenkins server.
In Jenkins, go to Credentials, and add a new Credential like this:
6) Add a clone step to your pipeline using the credential just created.
stage('Clone sources') {
steps {
git credentialsId: 'gitlab-jenkins-user', branch: 'develop', url: 'https://my.gitlab.org/test.git'
}
}
I'm cheerful I found this blog! Every now and then, understudies need to psychologically the keys of beneficial artistic articles forming. Your information about this great post can turn into a reason for such individuals.360DigiTMG pmp certification in malaysia
ReplyDeleteGreat post!! It's good to share this kind of articles and I hope you'll share an article about Data Science. By giving an institute like 360DigiTMG.it is one of the best institutes for certified courses.
ReplyDeletedata science course in noida
This post is very simple to read and appreciate without leaving any details out. Great work!
ReplyDeletebest data science courses in hyderabad
Such a very useful information!Thanks for sharing this useful information with us. Really great effort.
ReplyDeletedigital marketing courses aurangabad