[ci] Fix the SONiC version starting with HEAD issue#7299
[ci] Fix the SONiC version starting with HEAD issue#7299xumia wants to merge 1 commit intosonic-net:masterfrom
Conversation
| @@ -54,6 +54,7 @@ sonic_get_version() { | |||
| local describe=$(git describe --tags) | |||
| local latest_tag=$(git describe --tags --abbrev=0) | |||
| local branch_name=$(git rev-parse --abbrev-ref HEAD) | |||
There was a problem hiding this comment.
When checking out code, the azure pipeline checkout task does not set the local branch name, looks like the azure pipelines not support it very well. But azure pipeline provides a environment variable build.SourceBranchName, it tells which branch the code checked-out from.
Azure Pipelines:
$ git branch -vv
(HEAD detached at ca072d2) ca072d2 Disable CI/CD trigger
vmss-soni00007E:/agent/_work/1/s$ git rev-parse --abbrev-ref HEAD
HEAD
Jenkins:
jenkins-worker-2:/data/johnar/workspace/broadcom/buildimage-brcm-all$ git branch -vv
master 32b5b02 [sonic-platform-daemons] Update submodule (#7277)
jenkins-worker-2:/data/johnar/workspace/broadcom/buildimage-brcm-all$ git rev-parse --abbrev-ref HEAD
master
There was a problem hiding this comment.
it is better to address this from the azp script. otherwise, we have to cherry-pick this pr all the way to 201811 branch.
|
@xumia, can you close this pr if it is not needed? |
Why I did it
Fix the SONiC version starting with HEAD issue. For example, sonic-broadcom-HEAD.40620469-1d98d18cf.bin.
How I did it
Allow the azure pipelines to input the correct branch name to overwrite the default HEAD value.
How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)