-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathpush.sh
35 lines (30 loc) · 1.17 KB
/
push.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# Copyright (c) 2014-2019, Erik Dannenberg <[email protected]>
# All rights reserved.
function main() {
local image_id current_ns
# shellcheck disable=SC2154
expand_requested_target_ids "${_arg_target_id[@]}"
# shellcheck disable=SC2154
for image_id in "${__expand_requested_target_ids[@]}"; do
current_ns="${image_id%%/*}"
expand_image_id "${image_id}" "${_IMAGE_PATH}"
# shellcheck disable=SC2154
source_image_conf "${__expand_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}"
msg_warn "skipped, image is not build yet."
continue
fi
if [[ "${_last_push_auth_ns}" != "${current_ns}" ]]; then
# shellcheck disable=SC2154
push_auth "${current_ns}" "${_arg_registry_url}" || die "Error while logging into registry"
_last_push_auth_ns="${current_ns}"
fi
push_image "${image_id}" "${_arg_registry_url}"
done
}
main "$@"