bazel: fill microservice version on devbuild target (#1994)

* wip: fill microservice version on devbuild

* fill microservice versin on `devbuild`
This commit is contained in:
Moritz Sanft 2023-07-06 08:46:06 +02:00 committed by GitHub
parent e6dbb13c6c
commit c7457bd942
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 0 deletions

View file

@ -8,6 +8,9 @@
lib=$(realpath @@BASE_LIB@@) || exit 1
stat "${lib}" >> /dev/null || exit 1
yq=$(realpath @@YQ@@)
stat "${yq}" >> /dev/null
# shellcheck source=../sh/lib.bash
if ! source "${lib}"; then
echo "Error: could not find import"
@ -59,3 +62,12 @@ ln -sf "$(replace_prefix "${host_cache}" "${builder_cache}" "${upgrade_agent}")"
ln -sf "$(replace_prefix "${host_cache}" "${builder_cache}" "${cdbg}")" "${workdir}/cdbg"
ln -sf "$(replace_prefix "${host_cache}" "${builder_cache}" "${container_sums}")" "${workdir}/container_sums.sha256"
ln -sf "$(replace_prefix "${host_cache}" "${builder_cache}" "${cli}")" "${workdir}/constellation"
build_version=$("${workdir}"/constellation version | grep ^Version: | awk '{print $2}')
if [[ ! -f "${workdir}/constellation-conf.yaml" ]]; then
echo "constellation-conf.yaml not present in workspace"
echo "Build version: ${build_version}"
else
$yq -i eval ".microserviceVersion=\"${build_version}\"" ./constellation-conf.yaml
echo "Microservice version updated to ${build_version} in constellation-conf.yaml"
fi