Moved jenkins job from pipeline to multibranch pipeline, now a git checkout doesn't work?

539 Views Asked by At

I recreated a job to be a Multibranch pipeline, so I could better isolate the changes being tested from the prod build. However, directly after changing it, with no changes to the Jenkinsfile, I'm getting the below error

hudson.plugins.git.GitException: Command "git checkout -f 33975bbbdaeb7c6f0461f3100f6d092fa955c4de" returned status code 128

If I go back and run it in the old job, it runs without an issue, it is just in the multibranch version of the job. Doesn't matter what branch I run it against either.

The code in question that's failing is a second checkout (the Jenkinsfile is stored in another repo from this bit).

checkout([
  $class: 'GitSCM',
  branches: [[name: '*/master']],
  extensions: scm.extensions + [
  [
    $class: 'RelativeTargetDirectory', 
    relativeTargetDir: 'sw'
  ],
  [
    $class: 'CloneOption', 
    depth: 1, 
    noTags: false, 
    reference: '', 
    shallow: true, 
    timeout: 30
  ] 
  ], 
  userRemoteConfigs: [[
    credentialsId: "someCred", 
    url: 'ssh://[email protected]/repo/foo'
  ]]
])

It's a declarative pipeline

0

There are 0 best solutions below