-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy
executable file
·34 lines (27 loc) · 1.76 KB
/
deploy
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
#!/usr/bin/env sh
# (c) 2016 DataNexus Inc. All Rights Reserved.
# Licensed software not for distribution
#
# kafka platform deployment wrapper
: "${AWS_PROFILE:=datanexus}" && export AWS_PROFILE=${AWS_PROFILE} # sets this to a reasonable ~/.aws/credentials default
: "${AZURE_PROFILE:=datanexus}" && export AZURE_PROFILE=${AZURE_PROFILE} # sets this to a reasonable ~/.azure/credentials default
if [ $# -eq 0 ] || [ "$1" = "-h" ] ; then
printf "Usage: deploy [-h]\\thelp\\n"
printf "\\t deploy [INVENTORY TENANT PROJECT CLOUD REGION DOMAIN CLUSTER]\\tdeploy %s overlay with the specified values\\n" "$application"
printf "Example: deploy datanexus demo aws us-east-1 development none\\n"
exit 0
fi
tenant=`/usr/bin/basename ${2}` # derive tenant name from the path
application=confluent # application overlay to deploy
# derive the cluster if not passed in
if [ $# -eq 7 ] ; then
cluster=`basename ${1} | cut -d. -f2`
else
cluster=${8}
fi
# if check is passed in as the last argument run the drift code
for i in "$@" ; do
[[ $i == "drift" ]] && ./provision-kafka --check --diff --inventory=${1} --tags "$application" -e "tenant_config_path=${2} project=${3} cloud=${4} region=${5} domain=${6} cluster=${cluster} tenant=${tenant} application=${application} key_path=${7}" | ./check && exit ;
[[ $i == "replication" ]] && ./provision-replication --inventory=${1} --tags "$application" -e "tenant_config_path=${2} project=${3} cloud=${4} region=${5} domain=${6} cluster=${cluster} tenant=${tenant} key_path=${7}" && exit ;
done
./provision-kafka --inventory=${1} --tags "${application}" -e "tenant_config_path=${2} project=${3} cloud=${4} region=${5} domain=${6} cluster=${cluster} tenant=${tenant} application=${application} key_path=${7}"