Respect GIT_REF env var when building KAS
This MR starts to respect GIT_REF
that will be passed from CNG and Omnibus when they build KAS. GIT_REF
will enable us to identify which commit the build is based on.
As we are enabling the rolling release of KAS, GITLAB_KAS_VERSION
file in canonical GitLab project will be updated to SHA. But, since the VERSION
file is not always updated by the release tools (it updates VERSION
file only for public release), we can't identify which commit CNG and Omnibus builds are based on. With this MR, it will get the SHA from GIT_REF
and it use it as GitRef
in Gitlab-agent codebase.
Part of gitlab-com/gl-infra/delivery#20132 (closed).
FYI:
- CNG sets
GIT_COMMIT
env var when building KAS. gitlab-kas/Dockerfile#L25 We will update CNG to passGIT_REF
. - Omnibus doesn't set
GIT_COMMIT
when building KAS. We need to modify Omnibus to setGIT_REF
(MR). gitlab-kas.rb#L31-33
Example output:
$ cat VERSION
17.2.0-rc1
$ sh ./build/print_workspace_status.sh
STABLE_BUILD_VERSION v17.2.0-rc1
STABLE_BUILD_GIT_REF f9435609
$ GIT_REF=f943560913664907ed3e3f7c5ee217a928afb861 sh ./build/print_workspace_status.sh
STABLE_BUILD_VERSION v17.2.0-rc1
STABLE_BUILD_GIT_REF f943560913664907ed3e3f7c5ee217a928afb861
Edited by Taka Nishida