a76dcdf130
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. example for master branch ``` build_version: 'master.602-6efc0a88' debian_version: '10.7' kernel_version: '4.19.0-9-2-amd64' asic_type: vs commit_id: '6efc0a88' branch: 'master' release: 'none' build_date: Tue Dec 29 06:54:02 UTC 2020 build_number: 602 built_by: johnar@jenkins-worker-23 ``` example for 202012 release branch ``` build_version: '202012.602-6efc0a88' debian_version: '10.7' kernel_version: '4.19.0-9-2-amd64' asic_type: vs commit_id: '6efc0a88' branch: '202012' release: '202012' build_date: Tue Dec 29 06:54:02 UTC 2020 build_number: 602 built_by: johnar@jenkins-worker-23 ``` Signed-off-by: Guohan Lu <lguohan@gmail.com>
9 lines
323 B
Bash
Executable File
9 lines
323 B
Bash
Executable File
export build_version="${sonic_version}"
|
|
export asic_type="${sonic_asic_platform}"
|
|
export commit_id="$(git rev-parse --short HEAD)"
|
|
export branch="$(git rev-parse --abbrev-ref HEAD)"
|
|
export build_date="$(date -u)"
|
|
export build_number="${BUILD_NUMBER:-0}"
|
|
export built_by="$USER@$BUILD_HOSTNAME"
|
|
j2 sonic_version.yml.j2 > $1
|