question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Usage with Jenkinsfile for pipeline?

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Reactions:24
  • Comments:19

github_iconTop GitHub Comments

307reactions
roguishmountaincommented, May 5, 2017

Do you have lightweight checkout selected in the Pipeline SCM section? Unchecking lightweight checkout fixed this issue for me.

15reactions
aresarescommented, Mar 13, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using a Jenkinsfile
As discussed in the Defining a Pipeline in SCM, a Jenkinsfile is a text file that contains the definition of a Jenkins Pipeline...
Read more >
Jenkins Pipeline: Examples, Usage, and Best Practices
Jenkins Pipeline lets you implement continuous delivery (CD) pipelines on the Jenkins automation server. Pipelines are defined as text-based Jenkinsfiles.
Read more >
Best Jenkins Pipeline Tutorial - Create JenkinsFile
Inside Jenkins CI/CD, a pipeline is defined as a series of events or tasks which are interconnected in a particular order. In simple...
Read more >
Using a Jenkinsfile - GitHub Pages
As discussed in the Getting Started section, a Jenkinsfile is a text file that contains the definition of a Jenkins Pipeline and is...
Read more >
Creating a Jenkinsfile - CloudBees Documentation
A Jenkinsfile is a text file that contains the definition of a Jenkins Pipeline and is checked into source control. Consider the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found