Open bthharper opened 3 years ago
Tried adding in the refspecs:
The recommended git tool is: NONE
using credential sunsystems-jenkins-ci
Fetching changes from the remote Git repository
Cleaning workspace
> git.exe rev-parse --resolve-git-dir C:\Jenkins\workspace\Microsoft_Api_MR-1\.git # timeout=10
> git.exe config remote.origin.url ssh://git@blah.blah.blah.com:7888/group1/group2/project.git # timeout=10
> git.exe rev-parse --verify HEAD # timeout=10
No valid HEAD. Skipping the resetting
> git.exe clean -fdx # timeout=10
Pruning obsolete local branches
Fetching upstream changes from ssh://git@blah.blah.blah.com:7888/group1/group2/project.git
> git.exe --version # timeout=10
> git --version # 'git version 2.31.1.windows.1'
using GIT_SSH to set credentials SunSystems Jenkins CI
> git.exe fetch --tags --force --progress --prune -- ssh://git@blah.blah.blah.com:7888/group1/group2/project.git
+refs/heads/*:refs/remotes/origin/* +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/* # timeout=10
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Artifactory Server)
Stage "Artifactory Server" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Triggers)
Stage "Triggers" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
> git.exe rev-parse "origin/MR-1^{commit}" # timeout=10
> git.exe rev-parse "MR-1^{commit}" # timeout=10
Version report
GitLab EE 13.12.3-ee
Reproduction steps
I have a number of projects hosted in GitLab EE (under a group). The main branch is protected, merge requests are raised to push changes back to main.
I have created a Jenkins "GitLab Group" pointing to the group, and all the project underneath are recognized and builds are triggering as expected for the main and other branches, however, merge requests are being detected but when the job execute the clone / pull step fails in the JenkinsFile.
I suspect the issue is the checkout, but cannot work out what to change here to make it work ...
I wonder if it might be something to o with the
refspec
not being set, above to+refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
.Results
Expected result:
Successful checkout / clone of MR.
Actual result: