-
Notifications
You must be signed in to change notification settings - Fork 23
/
validate
executable file
·52 lines (44 loc) · 1.31 KB
/
validate
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
#! /usr/bin/env bash
VALID=true
if [[ -z "${DIGITAL_OCEAN_TOKEN}" ]]; then
VALID=false
echo -e "digital ocean token [\e[31mnot set\e[0m]"
else
echo -e "digital ocean token [\e[32mok\e[0m]"
fi
if [[ -z "${DIGITAL_OCEAN_SSH_KEY_NAME}" ]]; then
VALID=false
echo -e "digital ocean ssh key name [\e[31mnot set\e[0m]"
else
echo -e "digital ocean ssh key name [\e[32mok\e[0m]"
fi
if [[ -z "${DIGITAL_OCEAN_PRIVATE_KEY}" ]]; then
VALID=false
echo -e "digital ocean private key [\e[31mnot set\e[0m]"
else
echo -e "digital ocean private key [\e[32mok\e[0m]"
fi
if [[ -z "${CLUSTER_NAME_PREFIX}" ]]; then
VALID=false
echo -e "cluster name prefix [\e[31mnot set\e[0m]"
else
echo -e "cluster name prefix [\e[32mok\e[0m]"
fi
if [[ -z "${KUBECONFIG}" ]]; then
VALID=false
echo -e "kubeconfig configuration [\e[31mnot set\e[0m]"
else
echo -e "kubeconfig configuration [\e[32mok\e[0m]"
fi
if [[ -z "${VAGRANT_DOTFILE_PATH}" ]]; then
VALID=false
echo -e "vagrant dotfile path [\e[31mnot set\e[0m]"
else
echo -e "vagrant dotfile path [\e[32mok\e[0m]"
fi
if [ $VALID = false ]; then
echo -e "\n\e[31mnot configured properly, kindly following the instruction in README.md\e[0m"
exit 1
else
echo -e "\n\e[32mconfiguration looks good\e[0m"
fi