-
Bug
-
Resolution: Won't Fix
-
Major
-
None
I have a single job configured to build all branches of a git repo and poll for changes, and I have been experiencing a bug with build triggering.
Steps to reproduce
- Create a new repo locally and run these in the repo:
touch somefile.txt git commit -m "Add a file" somefile.txt
- Create a new repo on github
- Create a Jenkins job with this configuration:
- Set 'Repository URL' to the new github repo
- Set 'Branches to build' to '**'
- Check 'Prune remote branches before build', 'Skip internal tag', 'Clean after checkout', 'Recursively update submodules', 'Wipe out workspace before build'
- Check 'Poll SCM'
- Set 'Schedule' to '* * * * *'
- Add the following shell script as a build step:
echo $GIT_BRANCH
- Push the master branch of your local repo to github
- Wait for Jenkins build (build #1)
- Run these in your local repo:
git checkout -b feature master echo stuff > somefile.txt git commit -m "Some changes" somefile.txt git push origin feature
- Wait for Jenkins build (build #2)
- Run these in your local repo:
git checkout master git merge feature git push origin master
What happens
After step 5, build #1 prints 'origin/master'. After step 7, build #2 prints 'origin/feature'. After step 8, nothing happens in Jenkins.
What should happen
Builds #1 and #2 are fine. There should be a build #3 after step 8 which prints 'origin/master'.