2024-08-08 06:01:49 +05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
STARTDIR=server-origin
|
|
|
|
|
|
|
|
if [ "$(id -u)" != "0" ]; then
|
2024-08-14 10:49:54 +05:00
|
|
|
echo -e "\033[31mThis script requires superuser rights.\033[0m"
|
|
|
|
exit 0
|
2024-08-08 06:01:49 +05:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Please provide the DOMAIN_NAME as an argument"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-08-14 10:49:54 +05:00
|
|
|
trap 'echo -e "\033[31minstall.sh: Something went wrong\033[0m"; exit 1' ERR
|
2024-08-08 06:01:49 +05:00
|
|
|
set -e
|
|
|
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2024-08-08 06:20:46 +05:00
|
|
|
DOMAIN=$1
|
2024-08-14 10:49:54 +05:00
|
|
|
SECRETS_PATH=/data/secrets/$DOMAIN/$DOMAIN.env
|
|
|
|
source $SECRETS_PATH
|
2024-08-08 06:01:49 +05:00
|
|
|
|
|
|
|
cd /data/utils
|
2024-08-08 06:32:17 +05:00
|
|
|
echo "Install docker..."
|
2024-08-08 06:01:49 +05:00
|
|
|
bash init-docker.sh
|
|
|
|
|
2024-08-08 06:32:17 +05:00
|
|
|
echo "Init cron list..."
|
2024-08-14 10:49:54 +05:00
|
|
|
sudo bash cron-list.sh
|
2024-08-08 06:01:49 +05:00
|
|
|
|
2024-08-14 10:49:54 +05:00
|
|
|
echo "Clone backup.git..."
|
2024-08-08 06:01:49 +05:00
|
|
|
cd /data
|
|
|
|
git clone git@$GIT_SSH_DOMAIN:$GIT_USER/backup.git
|
|
|
|
|
2024-08-31 02:26:11 +05:00
|
|
|
echo "Init traefik..."
|
2024-08-14 10:49:54 +05:00
|
|
|
cd /data
|
2024-08-08 06:01:49 +05:00
|
|
|
git clone git@$GIT_SSH_DOMAIN:$GIT_USER/traefik.git
|
|
|
|
cd traefik
|
2024-08-31 02:26:11 +05:00
|
|
|
sudo bash install.sh
|
2024-08-08 06:01:49 +05:00
|
|
|
|
2024-08-31 02:26:11 +05:00
|
|
|
echo "Init postgres..."
|
2024-08-08 06:01:49 +05:00
|
|
|
cd /data
|
|
|
|
git clone git@$GIT_SSH_DOMAIN:$GIT_USER/postgres.git
|
|
|
|
cd postgres
|
2024-08-31 02:26:11 +05:00
|
|
|
sudo bash install.sh
|
2024-08-08 06:01:49 +05:00
|
|
|
|
2024-08-31 02:26:11 +05:00
|
|
|
echo "Init pgadmin..."
|
|
|
|
cd /data
|
|
|
|
git clone git@$GIT_SSH_DOMAIN:$GIT_USER/pgadmin.git
|
|
|
|
cd pgadmin
|
|
|
|
sudo bash install.sh
|
|
|
|
|
|
|
|
echo "Init gitea..."
|
2024-08-08 06:01:49 +05:00
|
|
|
cd /data
|
|
|
|
git clone git@$GIT_SSH_DOMAIN:$GIT_USER/gitea.git
|
|
|
|
cd gitea
|
2024-08-31 02:26:11 +05:00
|
|
|
sudo bash install.sh
|
2024-08-14 10:49:54 +05:00
|
|
|
|
2024-08-31 02:26:11 +05:00
|
|
|
echo "Init mariadb..."
|
2024-08-14 10:49:54 +05:00
|
|
|
cd /data
|
|
|
|
git clone git@$GIT_SSH_DOMAIN:$GIT_USER/mariadb.git
|
|
|
|
cd mariadb
|
2024-08-31 02:26:11 +05:00
|
|
|
sudo bash install.sh
|
|
|
|
|
2024-08-08 06:01:49 +05:00
|
|
|
|
2024-08-14 10:49:54 +05:00
|
|
|
echo "Install blog-wp..."
|
|
|
|
cd /data
|
|
|
|
git clone git@$GIT_SSH_DOMAIN:$GIT_USER/blog-wp.git
|
|
|
|
cd blog-wp
|
|
|
|
sudo docker compose up -d
|
|
|
|
|
|
|
|
echo "Await 10s before blog-wp-install..."
|
|
|
|
sleep 10
|
|
|
|
|
|
|
|
echo "Install blog-wp-install..."
|
|
|
|
cd /data
|
|
|
|
git clone git@$GIT_SSH_DOMAIN:$GIT_USER/blog-wp-install.git
|
|
|
|
cd blog-wp-install
|
2024-08-14 13:44:54 +05:00
|
|
|
sudo bash install.sh
|
2024-08-14 10:49:54 +05:00
|
|
|
|
|
|
|
echo "Install tetris..."
|
|
|
|
cd /data
|
|
|
|
git clone git@$GIT_SSH_DOMAIN:$GIT_USER/tetris.git
|
|
|
|
cd tetris
|
|
|
|
sudo docker compose build
|
|
|
|
sudo docker compose up -d
|
2024-08-08 06:01:49 +05:00
|
|
|
|
2024-08-14 10:49:54 +05:00
|
|
|
trap - ERR
|
2024-08-08 06:01:49 +05:00
|
|
|
echo "Install server-origin complete"
|