client: new internal client versioning system

- Version is now determined on-the-fly from manifest file
- Internal versioning no longer depends on environment file
This commit is contained in:
2024-07-12 12:30:30 -07:00
parent c68463bd2b
commit 4d3eef6067
6 changed files with 44 additions and 22 deletions

View File

@@ -49,6 +49,7 @@ fi
# Remaining "constructor" implementation
function lib_docker::__docker()
{
# TODO: refactor into lib_gen
# Docker-related files
[ -z "$DOCKER_FINANCE_CLIENT_REPO" ] && lib_utils::die_fatal
declare -g global_repo_dockerfiles="${DOCKER_FINANCE_CLIENT_REPO}/client/Dockerfiles/"
@@ -77,6 +78,7 @@ function lib_docker::__docker()
lib_utils::print_debug "Generating '${_path}'"
sed \
-e "s|@DOCKER_FINANCE_VERSION@|${global_client_version}|g" \
-e "s|@DOCKER_FINANCE_IMAGE@|${global_image}:${global_tag}|g" \
-e "s|@DOCKER_FINANCE_CONTAINER@|${global_container}|g" \
-e "s|@DOCKER_FINANCE_NETWORK@|${global_network}|g" \
@@ -674,6 +676,7 @@ function lib_docker::__version()
container)
# Feed dependency manifest (client is not bind-mounted for security reasons)
local _manifest
# TODO: use global_repo_manifest
_manifest="$(<${DOCKER_FINANCE_CLIENT_REPO}/client/docker-finance.yaml)"
# NOTE: uses variable "callback"
@@ -724,7 +727,7 @@ function lib_docker::__version()
# TODO: add build type
echo
echo -e "docker-finance v${DOCKER_FINANCE_VERSION} | commit: $_hash | build: $global_platform"
echo -e "docker-finance ${DOCKER_FINANCE_VERSION} | commit: $_hash | build: $global_platform"
;;
*)