forked from coollabsio/coolify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
43 lines (40 loc) · 1.84 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
#!/bin/bash
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git pull
echo "#### Building base image."
docker build -t coolify-base -f install/Dockerfile-base .
if [ $? -ne 0 ]; then
echo '#### Ooops something not okay!'
exit 1
fi
echo "#### Checking configuration."
docker run --rm -w /usr/src/app coolify-base node install/install.js --check
if [ $? -ne 0 ]; then
echo '#### Missing configuration.'
exit 1
fi
case "$1" in
"all")
echo "#### Rebuild everything."
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /data/coolify:/data/coolify -u root -w /usr/src/app coolify-base node install/install.js --type all
;;
"coolify")
echo "#### Rebuild coolify."
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /data/coolify:/data/coolify -u root -w /usr/src/app coolify-base node install/install.js --type coolify
;;
"proxy")
echo "#### Rebuild proxy."
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /data/coolify:/data/coolify -u root -w /usr/src/app coolify-base node install/install.js --type proxy
;;
"upgrade-phase-1")
echo "#### Rebuild coolify from frontend request phase 1."
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /data/coolify:/data/coolify -u root -w /usr/src/app coolify-base node install/install.js --type upgrade
;;
"upgrade-phase-2")
echo "#### Rebuild coolify from frontend request phase 2."
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /data/coolify:/data/coolify -u root -w /usr/src/app coolify-base node install/update.js --type upgrade
;;
*)
echo "Use 'all' to build & deploy proxy+coolify, 'coolify' to build & deploy only coolify, 'proxy' to build & deploy only proxy."
exit 1
;;
esac