Reputation: 1069
I have following code to checkout master branch, if i want to checkout particluar commit from master branch, how can i achieve it.
parameters {
stringParam("COMMIT_SHA", "", "[Required] Short SHA of the commit used to build the image")
}
definition {
cpsScm {
scm {
git {
remote {
url("https://github.mywork")
credentials("mytoken")
}
branches("master")
}
}
scriptPath("azure/pipelines/build_service.jenkins")
}
}
I have tried
branches(master: ${COMMIT_SHA})
Upvotes: 0
Views: 901
Reputation: 6824
These are the available options that can be used in the branch specifier when checking out a pipeline with Git:
So in your case you can just use: branches(COMMIT_SHA)
Upvotes: 1