-
Notifications
You must be signed in to change notification settings - Fork 7
/
deploy.sh
executable file
·76 lines (61 loc) · 1.5 KB
/
deploy.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# A standalone deployment script for provisioning of VMs via the `odie-provision.yml` playbook.
#
# include::../target/help-deploy.sh.adoc[]
#
# See:
# - <<build.sh,build.sh>>
#
. scripts/lib.sh
export VERSION=$(cat INSTALLER_VERSION)
SCRIPT_NAME=$(basename "$0")
export ISO_NAME=dist/RedHat-ODIE-${VERSION}.iso
function usage() {
cat <<EOF
${bold} ODIE Deploy Script ${normal}
${bold}${underline}General Options${normal}
--help -h Display this useful help information
EOF
}
export params="$(getopt -o hi: -l help,skip-tags:,tags:,iso: --name "${SCRIPT_NAME}" -- "$@")"
if [[ $? -ne 0 ]]; then
usage
exit 1
fi
OPTIONS=""
eval set -- "$params"
while true
do
case $1 in
--help|-h)
usage
exit 0
;;
--iso|-i)
ISO_NAME="$2"
shift
shift
;;
--tags)
OPTIONS="${OPTIONS} --tags ${2}"
shift;shift;
;;
--skip-tags)
OPTIONS="${OPTIONS} --skip-tags ${2}"
shift;shift;
;;
--)
shift; break ;;
esac
done
SIZE=$(du -sh ${ISO_NAME} | awk '{print $1;}')
function header() {
export HEADER="Deploying ${bold}ISO=${ISO_NAME}${normal} (${SIZE})"
echo
echo ${HEADER}
echo
echo "- View log file in another terminal : ${bold}tail -f ${LOG_FILE}${normal} "
echo
}
header
run_ansible_play "Deploying ODIE Enviroment" ./odie-provision.yml -e "boot_iso=$(realpath ${ISO_NAME})" -e @/opt/odie/config/build.yml ${OPTIONS}