forked from OpenConext/OpenConext-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision-single-component
executable file
·29 lines (28 loc) · 1.01 KB
/
provision-single-component
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
#!/bin/bash
set -e
if [ "$#" -lt 4 ]
then
echo "Usage: ./provision-single-component [ENVIRONMENT] [YOUR_USERNAME_ON_TARGET_HOSTS] [ABSOLUTE_PATH_TO_SECRETS_FILE] [COMPONENT_NAME]"
exit 1
fi
COMPONENTS=("authz-admin" "authz-playground" "mujina" "tomcat" "oauth" "authz-server" "eb" "shib" "sr" "teams" "voot" "mysql" "java" "legacy" "lb" "welcome" "grouper" "ldap" "pdp" "oidc" "aa" "metadata-exporter")
VALID_COMPONENT=0
for component in "${COMPONENTS[@]}"
do
if [ "$4" == "$component" ]; then
VALID_COMPONENT=1
break
fi
done
if [ $VALID_COMPONENT == 0 ]; then
echo "The component $4 is not a valid component, choose one of: ${COMPONENTS[*]}";
exit 1
fi
# echo "./ansible-env $1 provision-$1.yml $2 $3 --tags $4 ${@:5}"
if [ "$1" == "vm" ]; then
./ansible-env "$1" "provision-vm.yml" "$2" "$3" --tags "$4" "${@:5}"
elif [ "$1" == "diy" -o "$1" == "diy-test" ]; then
./ansible-env "$1" "provision-diy.yml" "$2" "$3" --tags "$4" "${@:5}"
else
./ansible-env "$1" "provision.yml" "$2" "$3" --tags "$4" "${@:5}"
fi