diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-04-21 00:45:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-04-21 00:45:06 +0200 |
commit | 9f430d51eec914c00249b9dc73e82500d312d7af (patch) | |
tree | bbd2241ccad3fa771109b99f68668ef4f990e85e | |
parent | c2f33e53cf694819878f95b7200c3a3abebe52dc (diff) | |
download | Puppet-9f430d51eec914c00249b9dc73e82500d312d7af.tar.gz Puppet-9f430d51eec914c00249b9dc73e82500d312d7af.tar.zst Puppet-9f430d51eec914c00249b9dc73e82500d312d7af.zip |
Make environment mandatory to install script
-rwxr-xr-x | bin/install_script.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/install_script.sh b/bin/install_script.sh index bd7f38b..36cc594 100755 --- a/bin/install_script.sh +++ b/bin/install_script.sh | |||
@@ -5,6 +5,9 @@ cat <<EOF | |||
5 | $(basename $0) [options] | 5 | $(basename $0) [options] |
6 | --help,-h This help | 6 | --help,-h This help |
7 | 7 | ||
8 | Please chose environment: | ||
9 | --environment env Environment to use for the install | ||
10 | |||
8 | One of the following options is necessary: | 11 | One of the following options is necessary: |
9 | --instance-id id Id of the cloud instance | 12 | --instance-id id Id of the cloud instance |
10 | --vps-id id Id of the vps | 13 | --vps-id id Id of the vps |
@@ -17,14 +20,12 @@ $(basename $0) [options] | |||
17 | --no-reboot-start Don't reboot to rescue at the beginning | 20 | --no-reboot-start Don't reboot to rescue at the beginning |
18 | --no-reboot-end Don't reboot to normal at the end | 21 | --no-reboot-end Don't reboot to normal at the end |
19 | --git-branch branch Use another puppet branch (default: master) | 22 | --git-branch branch Use another puppet branch (default: master) |
20 | --environment env Environment to use for the install (default: production) | ||
21 | EOF | 23 | EOF |
22 | } | 24 | } |
23 | 25 | ||
24 | set -e | 26 | set -e |
25 | 27 | ||
26 | git_branch=master | 28 | git_branch=master |
27 | environment=production | ||
28 | host_user="" | 29 | host_user="" |
29 | password="" | 30 | password="" |
30 | T="" | 31 | T="" |
@@ -89,7 +90,7 @@ while [ -n "$1" ]; do | |||
89 | shift | 90 | shift |
90 | done | 91 | done |
91 | 92 | ||
92 | if [ -z "$T" -o -z "$host_id" ]; then | 93 | if [ -z "$T" -o -z "$host_id" -o -z "$environment" ]; then |
93 | usage | 94 | usage |
94 | exit 1 | 95 | exit 1 |
95 | fi | 96 | fi |