mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-12 17:07:31 +00:00
Merge pull request #13861 from keymanapp/maint/common/dockermerge
This commit is contained in:
commit
4fb6d2756a
1 changed files with 3 additions and 52 deletions
|
|
@ -28,62 +28,13 @@ builder_describe \
|
|||
|
||||
builder_parse "$@"
|
||||
|
||||
_add_build_args() {
|
||||
local var=$1
|
||||
local default_var=$2
|
||||
local name=$3
|
||||
local value
|
||||
|
||||
value="${!var:=${!default_var:-}}"
|
||||
|
||||
build_args+=(--build-arg="${var}=${value}")
|
||||
|
||||
if [[ -n "${build_version:-}" ]]; then
|
||||
build_version="${build_version}-${name:-}${value}"
|
||||
else
|
||||
build_version="${name}${value}"
|
||||
fi
|
||||
}
|
||||
|
||||
_convert_parameters_to_build_args() {
|
||||
build_args=()
|
||||
build_version=
|
||||
local required_node_version keyman_default_distro
|
||||
# shellcheck disable=SC2034
|
||||
required_node_version="$(_print_expected_node_version)"
|
||||
# shellcheck disable=SC2034
|
||||
keyman_default_distro="ubuntu"
|
||||
|
||||
_add_build_args DISTRO keyman_default_distro ""
|
||||
_add_build_args DISTRO_VERSION KEYMAN_DEFAULT_VERSION_UBUNTU_CONTAINER ""
|
||||
_add_build_args JAVA_VERSION KEYMAN_VERSION_JAVA java
|
||||
_add_build_args REQUIRED_NODE_VERSION required_node_version node
|
||||
_add_build_args REQUIRED_EMSCRIPTEN_VERSION KEYMAN_MIN_VERSION_EMSCRIPTEN emsdk
|
||||
|
||||
if [[ -n "${BASE_VERSION:-}" ]]; then
|
||||
build_args+=(--build-arg="BASE_VERSION=${BASE_VERSION}")
|
||||
fi
|
||||
}
|
||||
|
||||
_check_for_default_values() {
|
||||
if [[ -z "${DISTRO_VERSION:-}" ]] && [[ -z "${JAVA_VERSION:-}" ]]; then
|
||||
is_default_values=true
|
||||
else
|
||||
is_default_values=false
|
||||
fi
|
||||
}
|
||||
|
||||
_is_default_values() {
|
||||
${is_default_values}
|
||||
}
|
||||
|
||||
build_action() {
|
||||
local platform=$1
|
||||
|
||||
builder_echo debug "Building image for ${platform}"
|
||||
|
||||
if [[ "${platform}" == "base" ]]; then
|
||||
# shellcheck disable=SC2154 # set by _convert_parameters_to_build_args
|
||||
# shellcheck disable=SC2154 # set by convert_parameters_to_args
|
||||
docker pull "${DISTRO}:${DISTRO_VERSION}"
|
||||
elif [[ "${platform}" == "linux" ]]; then
|
||||
cp "${KEYMAN_ROOT}/linux/debian/control" "${platform}"
|
||||
|
|
@ -116,8 +67,8 @@ test_action() {
|
|||
"${platform}" -- ./build.sh configure,build,test:"${platform}"
|
||||
}
|
||||
|
||||
_check_for_default_values
|
||||
_convert_parameters_to_build_args
|
||||
check_for_default_values
|
||||
convert_parameters_to_args
|
||||
|
||||
if builder_has_action build; then
|
||||
build_action base
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue