client: lib_docker: factor env gen into lib_gen
- Related environment refactoring
This commit is contained in:
@@ -49,31 +49,21 @@ 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/"
|
||||
# Inherited from caller
|
||||
[ -z "$global_container" ] && lib_utils::die_fatal
|
||||
[ -z "$global_image" ] && lib_utils::die_fatal
|
||||
[ -z "$global_network" ] && lib_utils::die_fatal
|
||||
[ -z "$global_platform" ] && lib_utils::die_fatal
|
||||
[ -z "$global_tag" ] && lib_utils::die_fatal
|
||||
|
||||
case "$global_platform" in
|
||||
archlinux | ubuntu)
|
||||
global_repo_dockerfiles+="finance"
|
||||
;;
|
||||
dev-tools)
|
||||
global_repo_dockerfiles+="dev-tools"
|
||||
;;
|
||||
*)
|
||||
lib_utils::die_fatal "platform was not previously checked"
|
||||
;;
|
||||
esac
|
||||
# Inherited from caller (via lib_gen)
|
||||
[ -z "$global_client_version" ] && lib_utils::die_fatal
|
||||
[ -z "$global_repo_dockerfiles" ] && lib_utils::die_fatal
|
||||
|
||||
#
|
||||
# Generate docker-compose.yml
|
||||
#
|
||||
|
||||
[ -z "$global_env_file" ] && lib_utils::die_fatal
|
||||
[ -z "$global_shell_file" ] && lib_utils::die_fatal
|
||||
[ -z "$global_repo_dockerfiles" ] && lib_utils::die_fatal
|
||||
|
||||
local _path="${global_repo_dockerfiles}/docker-compose.yml"
|
||||
lib_utils::print_debug "Generating '${_path}'"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user