jenkinsjenkins-pipeline

From which branch is the Jenkinsfile loaded


I have made some changes on my Jenkinsfile and I want to test the new Jenkins pipeline before delivery.
I did commit my changes on a feature branch but when I run the Jenkins pipeline it is definetely not running the version commited on my feature branch.

See the logs below:

Obtained Jenkinsfile from git https://bitbucket-xxx.y.zzz/myrepo/myfolder/my-api.git 
[Pipeline] Start of Pipeline
....

Logs do not show which branch is checked out.

  1. Do you think the Jenkinsfile is the one on Master branch ?
  2. How can I test the pipeline without merging my feature branch on Master ?

EDIT: I added a branch specifier in the branch to build section enter image description here And it worked ! Thanks @unickq your answer led me to do this


Solution

  • Jenkinsfile loaded from master/main branch by default.

    To test it you need to change Branches to build in job configuration section. Or manually set the pipeline script there.