-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·70 lines (57 loc) · 1.5 KB
/
install.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
#!/bin/bash
# init install
echo -e "\033[0;62m\033[0;49;35m"
set -a && source .env.common.private && set +a
root_dir="$(pwd)"
log () {
echo -e "\033[0;49;35m"
# warning
if [[ "$2" == "2" ]]; then
echo -e "\033[35;43m$1\033[0m"
fi
# error
if [[ "$2" == "1" ]]; then
echo -e "\033[35;41m\033[33m$1\033[0m"
fi
# success
if [[ "$2" == "0" ]]; then
echo -e "\033[35;42m$1\033[0m"
fi
# normal
if [[ "$2" == "" ]]; then
echo -e "\033[35;46m$1\033[0m"
fi
}
prompt () {
log "$1" 2
read answer
echo "$answer"
}
gosu () {
if [ $( id -u ) -ne 0 ]; then
log "dp::(auth)::this command needs sudo, please add password for %p: " 2
sudo -v
# exit $?
fi
}
take () {
log "dp::(idle)::let's wait $1 seconds for $2." 2
while true; do echo -n .; sleep 1; done | pv -s $1 -S -F '%t %p' > /dev/null
}
log "dp::hermes::ci::(busy):: Installing on server: Deploying secrets."
./deploy-secrets.sh install
# sudo rm -rf /var/lib/rancher/k3s/server/manifests/traefik.yaml
# helm uninstall traefik traefik-crd -n kube-system
# sudo systemctl restart k3s
log "dp::hermes::ci::(busy):: Installing on server: installing dependencies." 2
ssh ${HERMES_REMOTE} "mkdir dp; \
cd dp; \
git clone https://github.com/dreampipcom/hermes.git; \
mv ../.env.*.private hermes/; \
cd hermes; \
git checkout ${HERMES_BRANCH}; \
git pull; \
chmod +x ./install-deps.sh; \
./install-deps.sh;
"
log "dp::hermes::ci::(idle)::all good." 0