-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy
executable file
·36 lines (29 loc) · 1.69 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
35
36
#!/usr/bin/env sh
# (c) Copyright 2016 DataNexus Inc. All Rights Reserved.
# telegraf deployment wrapper
: "${AWS_PROFILE:=datanexus}" && export AWS_PROFILE="$AWS_PROFILE" # sets this to a reasonable ~/.aws/credentials default
if [ $# -eq 0 ] || [ "$1" = "-h" ] ; then
printf "Usage: deploy [-h]\\thelp\\n"
printf "\\t deploy [FILE | TENANT PROJECT CLOUD REGION DOMAIN CLUSTER SSH_USER KAFKA_USER TENANT_PATH KEY_PATH APPLICATION_PATH]\\tdeploy %s overlay with FILE configuration or with the specified values\\n" "$application"
printf "Example: deploy telegraf datanexus demo aws us-east-1 development a centos kafka /tmp/datanexus /tmp /tmp/postgresql\\n"
printf "\\t deploy telegraf /tmp/configuration.yml\\n"
exit 0
fi
tenant=`/usr/bin/basename ${2}` # derive tenant name from the path
application=influxdb # overlay to deploy
# # if telegraf is deployed statically; grab the inventory from the front and dump the argument
# if [ $# -eq 2 ] && [ -f "$2" ]; then
# INVENTORY="--inventory=$2"
# shift && shift
# fi
./provision-influxdb --tags "${application}" --inventory=${1} -e "tenant_config_path=${2} tenant=${tenant}"
# if [ $# -eq 0 ] ; then
# likely called by the orchestrator to just pass through everything
# elif [ $# -eq 3 ] && [ "$2" = "-e" ]; then
# ./overlay-"$application" "$2" "$3"
# # deploy telegraf as an overlay without the orchestrator
# elif [ $# -eq 9 ] && [ -d "${9}" ]; then
# ./overlay-"$application" $INVENTORY -e "tenant=$1 project=$2 cloud=$3 region=$4 domain=$5 cluster=$6 user=$7 tenant_config_path=${8} key_path=${9}"
# elif [ $# -eq 1 ] && [ -f "$1" ] && [ -s "$1" ]; then
# ./provision-postgresql --tags "vm,$application" -e "configuration=$1"
# fi