This isn't as simple as just doing a parametrized build. I've already got a specific build process that will build and deploy whenever any of these branches are pushed to GitHub:
So if I've just pushed develop
and it built successfully, how do I trigger a manual build and have it pull feature/my-new-feature
(without doing a git push
)? I tried enabling parametrized build, adding a new string called branch
, and then adding a new branch specifier, */$branch
. I then ran a build and set branch
to feature/my-new-feature
and it still pulled from develop
.
I'd appreciate any help!
Best solution can be:
Add a string parameter in the existing job
Then in the Source Code Management
section update Branches to build
to use the string parameter you defined
If you see a checkbox labeled Lightweight checkout
, make sure it is unchecked.
The configuration indicated in the images will tell the jenkins job to use master
as the default branch, and for manual builds it will ask you to enter branch details (FYI: by default it's set to master
)