2021-03-24 22:11:14 +01:00
|
|
|
#!/bin/bash
|
2021-03-30 23:35:22 +02:00
|
|
|
echo '
|
|
|
|
##############################
|
|
|
|
#### Pulling Git Updates #####
|
|
|
|
##############################'
|
2021-03-24 22:11:14 +01:00
|
|
|
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git pull
|
2021-03-30 23:35:22 +02:00
|
|
|
|
2021-03-24 22:11:14 +01:00
|
|
|
if [ $? -ne 0 ]; then
|
2021-03-30 23:35:22 +02:00
|
|
|
echo '
|
|
|
|
####################################
|
|
|
|
#### Ooops something not okay! #####
|
|
|
|
####################################'
|
2021-03-24 22:11:14 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-03-30 23:35:22 +02:00
|
|
|
echo '
|
|
|
|
##############################
|
|
|
|
#### Building Base Image #####
|
|
|
|
##############################'
|
|
|
|
docker build --label coolify-reserve=true -t coolify-base -f install/Dockerfile-base .
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo '
|
|
|
|
####################################
|
|
|
|
#### Ooops something not okay! #####
|
|
|
|
####################################'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo '
|
|
|
|
##################################
|
|
|
|
#### Checking configuration. #####
|
|
|
|
##################################'
|
2021-03-24 22:11:14 +01:00
|
|
|
docker run --rm -w /usr/src/app coolify-base node install/install.js --check
|
|
|
|
if [ $? -ne 0 ]; then
|
2021-03-30 23:35:22 +02:00
|
|
|
echo '
|
|
|
|
##################################
|
|
|
|
#### Missing configuration ! #####
|
|
|
|
##################################'
|
2021-03-24 22:11:14 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
"all")
|
2021-03-30 23:35:22 +02:00
|
|
|
echo '
|
|
|
|
#################################
|
|
|
|
#### Rebuilding everything. #####
|
|
|
|
#################################'
|
2021-03-24 22:11:14 +01:00
|
|
|
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")
|
2021-03-30 23:35:22 +02:00
|
|
|
echo '
|
|
|
|
##############################
|
|
|
|
#### Rebuilding Coolify. #####
|
|
|
|
##############################'
|
2021-03-24 22:11:14 +01:00
|
|
|
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")
|
2021-03-30 23:35:22 +02:00
|
|
|
echo '
|
|
|
|
############################
|
|
|
|
#### Rebuilding Proxy. #####
|
|
|
|
############################'
|
2021-03-24 22:11:14 +01:00
|
|
|
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
|
|
|
|
;;
|
2021-03-30 22:15:37 +02:00
|
|
|
"upgrade-phase-1")
|
2021-03-30 23:35:22 +02:00
|
|
|
echo '
|
|
|
|
################################
|
|
|
|
#### Upgrading Coolify P1. #####
|
|
|
|
################################'
|
2021-03-30 22:15:37 +02:00
|
|
|
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")
|
2021-03-30 23:35:22 +02:00
|
|
|
echo '
|
|
|
|
################################
|
|
|
|
#### Upgrading Coolify P2. #####
|
|
|
|
################################'
|
2021-03-30 22:15:37 +02:00
|
|
|
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
|
|
|
|
;;
|
2021-03-24 22:11:14 +01:00
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|