I've been reading a lot about Jenkins 2.x and the pipeline system in order to create a setup with the following features;
- A SCM managed Jenkinsfile.
- Building each commit to the (git) repository.
- Passing parameters through the webhook trigger.
So far I failed to build a working set-up because of various reasons, some of the things I tried are;
Multibranch Pipeline Setup
- My jenkinsfile from the git repository was picked up perfectly.
- Triggering through the git plugins
notifyCommit
webhook works well (http://localhost:8080/git/notifyCommit?url=...) - There is no way to pass additional parameters this way.
So I was wondering if there is any other way to trigger these builds? The trigger build remotely and generic webhook options do not show up when configuring the multibranch pipeline.
Regular Pipeline
- Creating the pipeline works and the trigger options mentioned earlier are available.
- Picked 'Jenkinsfile from SCM' and used git.
- Tried blank for 'branches', tried refs/heads/**,... a whole bunch of combinations.
Does Jenkins in this case assume a Jenkinsfile to be present in each branch? It seems like the notifyCommit
webhook doesn't even trigger this.
If I force a manual build Jenkins doesn't know what to build it seems:
git fetch --tags --progress git@bitbucket.org:project.git +refs/heads/*:refs/remotes/origin/*
Seen branch in repository origin/a
Seen branch in repository origin/master
Seen 2 remote branches
git tag -l # timeout=10
git rev-parse refs/tags/tagY^{commit} # timeout=10
git rev-parse refs/tags/tagX^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE