-
Notifications
You must be signed in to change notification settings - Fork 3
/
deploy.sh
executable file
·67 lines (51 loc) · 1.6 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
#! /bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo -e "\033[32mPerforming some checks: binaries, versions ..\033[0m"
if ! command -v vagrant &> /dev/null
then
echo "Vagrant binary could not be found"
exit 1
fi
if ! command -v terraform &> /dev/null
then
echo "Terraform binary could not be found"
exit 1
fi
tfversion=$(terraform version | awk 'NR==1{gsub("v0.",""); print $2}')
tfrequired="13.1"
if (( $(echo "$tfversion < $tfrequired" | bc -l) ));
then
echo "Terraform version required >= v0.$tfrequired"
exit 1
fi
echo -e "\033[32mProvisioning VM..\033[0m"
export VAGRANT_CWD="${DIR}/vagrant"
vagrant validate && \
vagrant up
if [[ $TERRAFORM_LABS == "false" ]];
then
echo -e "\033[32m
Done!
For services UI:
=> Vault: http://localhost:8200, pwd: root
=> Consul: http://localhost:8500
=> Nomad: http://localhost:4646
\033[0m"
exit 1
fi
echo -e "\033[32mDeploying workload..\033[0m"
cd ${DIR}/terraform
terraform init && terraform plan && terraform apply -auto-approve && \
echo -e "\033[32m
Done!
Add \"127.0.0.1 faasd-gateway\" to your \"/etc/hosts\" file to reach Openfaasd (same for Prometheus and Grafana).
For services UI:
=> Vault: http://localhost:8200, pwd: root
=> Consul: http://localhost:8500
=> Nomad: http://localhost:4646
=> Minimal services: http://localhost:8080
=> OpenFaas: http://faasd-gateway:8080, user/pwd: admin/password
=> Prometheus: http://prometheus:8080
=> Grafana: http://grafana:8080, user/pwd: admin/admin
\033[0m"