forked from debezium/container-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-mongo.sh
executable file
·35 lines (29 loc) · 1.19 KB
/
build-mongo.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
#!/bin/bash
set -eo pipefail
if [[ -z "$1" ]]; then
echo ""
echo "A version must be specified."
echo ""
echo "Usage: build-mongo <version>";
echo ""
exit 1;
fi
if [ -z "${DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME}" ]; then
DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME=quay.io/debezium
fi;
if [ -z "${DEBEZIUM_DOCKER_REGISTRY_SECONDARY_NAME}" ]; then
DEBEZIUM_DOCKER_REGISTRY_SECONDARY_NAME=debezium
fi;
echo ""
echo "****************************************************************"
echo "** Building ${DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME}/mongo-initiator:$1"
echo "****************************************************************"
docker build -t "${DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME}/mongo-initiator:$1" "mongo-initiator/$1"
if [ "$PUSH_IMAGES" == "true" ]; then
echo "Pushing the image into the registry"
docker push "${DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME}/mongo-initiator:$1"
if [ -n "${DEBEZIUM_DOCKER_REGISTRY_SECONDARY_NAME}" ]; then
docker tag "${DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME}/mongo-initiator:$1" "${DEBEZIUM_DOCKER_REGISTRY_SECONDARY_NAME}/mongo-initiator:$1"
docker push "${DEBEZIUM_DOCKER_REGISTRY_SECONDARY_NAME}/mongo-initiator:$1"
fi;
fi