generated from cyberark/conjur-template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpush.sh
executable file
·39 lines (32 loc) · 1.23 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
36
37
38
39
#!/bin/bash -e
cd "$(dirname "$0")"
. ../push.sh
set -a # Marks all created or modified variables or functions for export.
source ../versions.env
set +a
REGISTRY="$(normalize_repo_name "$1")"
# ${1} - image name
# ${2} - image tag
# ${3} - tag suffix
push_image() {
LOCAL_IMAGE="${1}:${2}"
IMAGE="cyberark/${1}"
TAG=$(<../VERSION)
if [[ -z "${REGISTRY:-}" ]]; then
# Push to public registry with Ubuntu version and and image versions
tag_and_push "${LOCAL_IMAGE}" "${IMAGE}:${UBUNTU_VERSION}-${TAG}${3}"
tag_and_push "${LOCAL_IMAGE}" "${IMAGE}:${UBUNTU_VERSION}${3}"
tag_and_push "${LOCAL_IMAGE}" "${IMAGE}:${TAG}${3}"
tag_and_push "${LOCAL_IMAGE}" "${IMAGE}:${2}"
else
# Push to internal locations with Ubunntu version and image versions
tag_and_push "${LOCAL_IMAGE}" "${REGISTRY}${IMAGE}:${UBUNTU_VERSION}-${TAG}${3}"
tag_and_push "${LOCAL_IMAGE}" "${REGISTRY}${IMAGE}:${UBUNTU_VERSION}${3}"
tag_and_push "${LOCAL_IMAGE}" "${REGISTRY}${IMAGE}:${TAG}${3}"
tag_and_push "${LOCAL_IMAGE}" "${REGISTRY}${IMAGE}:${2}"
fi
}
push_image "ubuntu-ruby-builder" "latest" ""
push_image "ubuntu-ruby-fips" "latest" ""
push_image "ubuntu-ruby-postgres-fips" "latest" ""
push_image "ubuntu-ruby-fips" "slim" "-slim"