-
Notifications
You must be signed in to change notification settings - Fork 12
/
build-dockers
executable file
·52 lines (40 loc) · 1.07 KB
/
build-dockers
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
#!/usr/bin/env bash
set -e
source build-versions
TAG="${TAG:="${1}"}"
SR_VERSION="${SR_VERSION:="${2}"}"
CONFLUENT_VERSION="${CONFLUENT_VERSION:="${3}"}"
KAFKA_VERSION="${KAFKA_VERSION:="${4}"}"
CONNECT_CLI_VERSION="${CONNECT_CLI_VERSION:="${5}"}"
function die() {
for m in "${@}"; do
echo -e "${m}"
done
exit 1
}
declare -a ENV_ARRAY=(\
"TAG" "CONFLUENT_VERSION" \
"SECRET_PROVIDER_VERSION" \
"CONNECT_CLI_VERSION" \
"KAFKA_VERSION" \
"SR_VERSION" \
)
echo -e "\nChecking Environment"
for e in "${ENV_ARRAY[@]}"; do
[[ -z "${!e}" ]] && die "\tEnv ${e} was not provided" \
"\tUsage: ./build-dockers tag sr-version confluent-version kafka-version cli-version"
echo -e "\tEnv ${e} has been set with: ${!e}"
done
echo -e "\nBuliding kafka-connect-base\n"
./kafka-connect-base/build \
"${SR_VERSION}" \
"${CONFLUENT_VERSION}" \
"${SECRET_PROVIDER_VERSION}" \
"${CONNECT_CLI_VERSION}"
if [[ "${10}" == "dev" ]]; then
exit 0
fi
./stream-reactor/build \
"${TAG}" \
"${SR_VERSION}" \
"${KAFKA_VERSION}"