-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy
More file actions
executable file
·31 lines (25 loc) · 1.29 KB
/
deploy
File metadata and controls
executable file
·31 lines (25 loc) · 1.29 KB
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
#!/usr/bin/env sh
# (c) Copyright 2016 DataNexus Inc. All Rights Reserved.
# tripwire 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 tripwire INVENTORY TENANT_CONFIG \\tdeploy %s overlay with the specified values\\n" "$application"
printf "Example: deploy tripwire hostsfile ../datanexus \\n"
exit 0
fi
application="${1}" # overlay to deploy
tenant=`/usr/bin/basename ${3}` # derive tenant name from the path; currently unused
# if tripwire is deployed statically; grab the inventory from the front and dump the argument
if [ $# -gt 2 ] && [ -f "${2}" ]; then
INVENTORY="--inventory=${2}"
shift && shift
fi
# if report is passed in as the last argument set the tag to just run the report
for i in "$@" ; do
[[ $i == "check" ]] && application=${i} ;
[[ $i == "update" ]] && application=${i} ;
[[ $i == "report" ]] && application=${i} ;
done
./provision-tripwire ${INVENTORY} --tags "$application" -e "tenant_config_path=${1} tenant=${tenant}"