Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow VSTS JenkinsQueueJob to pass the branch name for multibranch pipeline job #154

Merged
merged 1 commit into from
Mar 10, 2017

Conversation

yacaovsnc
Copy link
Contributor

In v5.3.3, we are assuming the jobname for a Multibranch Pipeline job is passed from VSTS / TFS JenkinsQueueJob task in the format of ${MultibranchPipelineJob}/${Branch}. This won't work for Multibranch Pipeline jobs in folders as we can't pinpoint which / splits the job and the branch.

In JenkinsQueueJob task 1.115.0, we are adding a separate field to specify the branch name. This will resolve all the ambiguities.

This fix requires JenkinsQueueJob 1.115.0.

Copy link
Contributor

@davidstaheli davidstaheli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One minor comment.

sourceBranch = jobName.substring(jobName.indexOf('/') + 1);
} else {
sourceBranch = payload.BuildVariables.get(BUILD_SOURCE_BRANCH);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not important, but consider saving the result of jobName.indexOf('/') instead of calling it twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants