Reputation: 14281
I want to checkout a git repo and then run its build so I tried:
sh "git clone --depth 1 -b master [email protected]:user/repo.git"
build './repo'
but that yields:
ERROR: No item named ./repo found
I've tried to use dir('repo') but apparently that errors when you run it from within docker (because kubernetes is stuck on an old version of docker that doesnt support this).
Any idea on how to run the build pipeline from the checked out repo?
Upvotes: 3
Views: 1523
Reputation: 6458
The 'build' pipeline steps expect a job name, not a pipeline folder with a Jenkinsfile
in its root folder.
The correct way to do this is to set the pipeline job with the Jenkinsfile, as described here ('In SCM' section), and call it by its Job name from your pipeline.
Pipelines are not built for chaining unless you use shared libraries where you put the Pipeline code in a Groovy class or as a step, but that it is a subject for a full article.
Upvotes: 5