forked from debezium/container-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-debezium.sh
executable file
·87 lines (74 loc) · 2.9 KB
/
build-debezium.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
set -eo pipefail
#
# Parameter 1: image name
# Parameter 2: path to component (if different)
#
build_docker_image () {
IMAGE_NAME=$1;
IMAGE_PATH=$2;
if [ -z "$IMAGE_PATH" ]; then
IMAGE_PATH=${IMAGE_NAME};
fi
IMAGE_PATH="${IMAGE_PATH}/${DEBEZIUM_VERSION}"
echo ""
echo "****************************************************************"
echo "** Validating debezium/${IMAGE_NAME}"
echo "****************************************************************"
echo ""
docker run --rm -i hadolint/hadolint:latest < "${IMAGE_PATH}"
echo "****************************************************************"
echo "** Building debezium/${IMAGE_NAME}:${DEBEZIUM_VERSION}"
echo "****************************************************************"
docker build -t "debezium/${IMAGE_NAME}:latest" "${IMAGE_PATH}"
if [ -z "$RELEASE_TAG" ]; then
echo "****************************************************************"
echo "** Stream Tag debezium/${IMAGE_NAME}:${DEBEZIUM_VERSION} "
echo "****************************************************************"
docker tag "debezium/${IMAGE_NAME}:latest" "debezium/${IMAGE_NAME}:${DEBEZIUM_VERSION}"
if [ "$PUSH_IMAGES" == "true" ]; then
echo "Pushing the stream image into the registry"
docker push "debezium/${IMAGE_NAME}:${DEBEZIUM_VERSION}"
if [ "$DEBEZIUM_VERSION" == "$LATEST_STREAM" ]; then
echo "Pushing the latest image into the registry"
docker push "debezium/${IMAGE_NAME}:latest"
fi
fi
fi
if [ -n "$RELEASE_TAG" ]; then
echo "****************************************************************"
echo "** Release Tag debezium/${IMAGE_NAME}:${RELEASE_TAG} "
echo "****************************************************************"
docker tag "debezium/${IMAGE_NAME}:latest" "debezium/${IMAGE_NAME}:${RELEASE_TAG}"
if [ "$PUSH_IMAGES" == "true" ]; then
echo "Pushing the stream image into the registry"
docker push "debezium/${IMAGE_NAME}:${RELEASE_TAG}"
fi
fi
}
if [[ -z "$1" ]]; then
echo ""
echo "A version must be specified."
echo ""
echo "Usage: build-debezium <version>";
echo ""
exit 1;
fi
DEBEZIUM_VERSION="$1"
build_docker_image zookeeper
build_docker_image kafka
build_docker_image connect-base
build_docker_image connect
build_docker_image server
if [[ "$SKIP_UI" != "true" ]]; then
build_docker_image debezium-ui ui
fi
build_docker_image example-mysql examples/mysql
build_docker_image example-mysql-gtids examples/mysql-gtids
build_docker_image example-postgres examples/postgres
build_docker_image example-mongodb examples/mongodb
echo ""
echo "**********************************"
echo "Successfully created Docker images"
echo "**********************************"
echo ""