Reputation: 199
After creating merge request in GitLab, merge request got failed and jenkins has deleted the failed job logs due to retention period defined under jenkins job. Now, i want to re-trigger that specific merge request only from gitlab so that it will trigger the merge request job in jenkins. Is it possible ? If yes, how can i do the same ?
P.S. There is a pipeline defined from Gitlab to Jenkins. Whenever a merge request get creates in gitlab, it triggers the Jenkins Merge Request job which merge the specific changes to the git master branch.
Upvotes: 10
Views: 13082
Reputation: 3483
Adding on the existing answers, note that you can override GitLab CI variables like CI_PIPELINE_SOURCE = 'merge_request_event' to specifically trigger your MR pipeline against a branch.
Upvotes: 0
Reputation: 121
Pipelines
tab.Run pipeline
.Upvotes: 10
Reputation: 4202
Yes you can retrigger the Gitlab Pipelines! There are two options available:
CI / CD
: https://gitlab.com/{user/organization}/{project}/pipelines
Run Pipeline
Create Pipeline
button.This will create and run a gitlab pipeline.
gitlab.com/projects/:id/trigger/pipeline
curl -X POST -F token=TOKEN -F ref=BRANCHNAME https://gitlab.com/api/v4/projects/7471909/trigger/pipeline
If you want to trigger a build manually in Jenkins you can also make use of an api in combination with a parameterized build:
curl -X POST JENKINS_URL/job/JOB_NAME/build --user USER:TOKEN --data-urlencode json='{"parameter": [{"name":"branch", "value":"master"}]}'
The parameter will be the branch to build; eg the branch for your merge request.
Upvotes: 6