sonic-buildimage/platform/vs/sonic-version/build_sonic_version.sh
Guohan Lu e38cc58bbc [build]: add branch and release name in sonic_version.yml
the branch refers the branch name that the commit is in,
for example master, 202012, 201911, ...
In case there is no branch, the name will be HEAD.

release is encoded in /etc/sonic/sonic_release file.
the file is only available for a release branch.
It is not available in master branch.

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-08-07 18:04:28 -07:00

10 lines
269 B
Bash
Executable File

tee $1 > /dev/null <<EOF
build_version: '$sonic_version'
asic_type: $sonic_asic_platform
commit_id: '$(git rev-parse --short HEAD)'
branch: '$(git rev-parse --abbrev-ref HEAD)'
build_date: $(date -u)
build_number: ${BUILD_NUMBER:-0}
built_by: $USER@$BUILD_HOSTNAME
EOF