-
Notifications
You must be signed in to change notification settings - Fork 2
/
push.sh
60 lines (37 loc) · 1.48 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
set -euo pipefail
TARGET_REPO="$1"
if [ -z "$TARGET_REPO" ]; then
echo "Target repo is mandatory" && exit 1
fi
IMAGE_BUILD=$(grep "^export IMAGE_BUILD=" build.sh | cut -d'=' -f2- | tr -d '"')
PG_VERSIONS=$(grep "^PG_VERSIONS=" build.sh | cut -d'=' -f2- | tr -d '"')
MYSQL_VERSIONS=$(grep "^MYSQL_VERSIONS=" build.sh | cut -d'=' -f2- | tr -d '"')
RELEASE_MAJOR=$(grep "^RELEASE_MAJOR=" buildDockerImage.sh | cut -d'=' -f2- | tr -d '"')
RELEASE_MINOR=$(grep "^RELEASE_MINOR=" buildDockerImage.sh | cut -d'=' -f2- | tr -d '"')
# Base
TAGS="${RELEASE_MAJOR}.${RELEASE_MINOR} ${RELEASE_MAJOR}.${RELEASE_MINOR}-${IMAGE_BUILD}"
for TAG in $TAGS; do
echo "docker push ${TARGET_REPO}:${TAG}"
docker push ${TARGET_REPO}:${TAG}
echo ""
done
# Postgresql
for PG_VERSION in $PG_VERSIONS; do
TAGS="${RELEASE_MAJOR}.${RELEASE_MINOR}-pg${PG_VERSION} ${RELEASE_MAJOR}.${RELEASE_MINOR}-pg${PG_VERSION}-${IMAGE_BUILD}"
for TAG in $TAGS; do
echo "docker push ${TARGET_REPO}:${TAG}"
docker push ${TARGET_REPO}:${TAG}
echo ""
done
done
# Mysql
for MYSQL_VERSION in $MYSQL_VERSIONS; do
MYSQL_RELEASE_VERSION=$(echo "$MYSQL_VERSION" | tr -d '.')
TAGS="${RELEASE_MAJOR}.${RELEASE_MINOR}-mysql${MYSQL_RELEASE_VERSION} ${RELEASE_MAJOR}.${RELEASE_MINOR}-mysql${MYSQL_RELEASE_VERSION}-${IMAGE_BUILD}"
for TAG in $TAGS; do
echo "docker push ${TARGET_REPO}:${TAG}"
docker push ${TARGET_REPO}:${TAG}
echo ""
done
done