Usage with Jenkinsfile for pipeline?
See original GitHub issueI’m new to the Pipelines feature, so I’m sure this is just a configuration error, but it may be a good starting point for a recipe in the docs.
I am trying to get a basic skeleton project building (which I’ll then flesh out with real build steps). I’ve successfully gotten my pipeline to run by manually adding it (the GH plugin couldn’t find the repo), and I was able to add the ghprb trigger in the project configuration page, and ghprb does try to kick off a build.
I believe that in order to pick up changes in my Jenkinsfile
, I need to set the pipeline to “Pipeline script from SCM”. I set everything up as I would for the regular checkout, using ${sha1}
as the Branch Specifier. However, when I triggered ghprb, my build failed with this message, which makes it appear as though the ${sha1}
placeholder is not being expanded at this stage:
hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/${sha1}:refs/remotes/origin/${sha1} --prune" returned status code 128:
stdout:
stderr: fatal: Couldn't find remote ref refs/heads/${sha1}
How can I configure the combination of ghprb and Pipelines to pull the pipeline definition from the PR?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:24
- Comments:19
Do you have lightweight checkout selected in the Pipeline SCM section? Unchecking lightweight checkout fixed this issue for me.
hudson.plugins.git.GitException: Command “git fetch --tags --force --progress --prune – origin +refs/heads/${BRANCH}:refs/remotes/origin/${BRANCH}” returned status code 128: with kubernetes agent and with Lightweight Checkout disabled