diff --git a/cmd/push.sh b/cmd/push.sh index 45fc5337..3b5f4612 100644 --- a/cmd/push.sh +++ b/cmd/push.sh @@ -12,7 +12,9 @@ function main() { expand_image_id "${image_id}" "${_IMAGE_PATH}" # shellcheck disable=SC2154 source_image_conf "${__expand_image_id}" - source_push_conf "${image_id}" + get_ns_dir_by_image_path "${__expand_image_id}" + # shellcheck disable=SC2154 + source_push_conf "${__get_ns_dir_by_image_path}" if ! image_exists "${image_id}"; then add_status_value "${image_id}" diff --git a/engine/docker.sh b/engine/docker.sh index 8f4aae26..325036df 100644 --- a/engine/docker.sh +++ b/engine/docker.sh @@ -743,9 +743,11 @@ function push_auth() { login_args=('-u' "${DOCKER_LOGIN}") # shellcheck disable=SC2153 if [[ -n "${DOCKER_PW}" ]]; then - login_args+=('-p' "${DOCKER_PW}") + login_args+=( '--password-stdin' ) + echo "${DOCKER_PW}" | "${DOCKER}" login "${login_args[@]}" || exit 1 + else + "${DOCKER}" login "${login_args[@]}" || exit 1 fi - "${DOCKER}" login "${login_args[@]}" || exit 1 else msg_info "using ${repository_url}" fi diff --git a/lib/core.sh b/lib/core.sh index 4de4a3e5..2a715637 100644 --- a/lib/core.sh +++ b/lib/core.sh @@ -298,15 +298,15 @@ function source_image_conf() { # Read namespace push.conf for given image_id # # Arguments: -# 1: image_id (i.e. kubler/busybox) +# 1: namespace_path - absolute function source_push_conf() { - local namespace - namespace="${1%%/*}" + local namespace_path + namespace_path="$1" # exit if we just sourced for this NS - [[ "${_last_sourced_push_conf}" == "${namespace}" ]] && return 0 + [[ "${_last_sourced_push_conf}" == "${namespace_path}" ]] && return 0 # shellcheck disable=SC1090 - [[ -f "${namespace}/push.conf" ]] && source "${namespace}/push.conf" - _last_sourced_push_conf="${namespace}" + [[ -f "${namespace_path}/push.conf" ]] && source "${namespace_path}/push.conf" + _last_sourced_push_conf="${namespace_path}" } # Check image dependencies and return base build container id for given image_id. Recursive.