websoft9/install/install_new.sh

36 lines
919 B
Bash
Raw Normal View History

2023-09-19 15:40:14 +08:00
#!/bin/bash
2023-09-19 18:12:37 +08:00
# Define PATH
2023-09-19 15:40:14 +08:00
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
2023-09-19 18:12:37 +08:00
# Export PATH
2023-09-19 15:40:14 +08:00
export PATH
2023-09-19 19:55:23 +08:00
# Define global vars
export http_port=80
export https_port=443
export cockpit_port=9000
export install_path="/data/websoft9"
export urls="https://w9artifact.blob.core.windows.net/release/websoft9"
2023-09-19 15:40:14 +08:00
if [[ "$1" == "dev" ]]; then
2023-09-19 18:12:37 +08:00
echo "update by dev artifact"
2023-09-19 19:55:23 +08:00
export urls="https://w9artifact.blob.core.windows.net/dev/websoft9"
2023-09-19 15:40:14 +08:00
fi
2023-09-19 17:44:20 +08:00
# Install runtime
2023-09-19 18:30:33 +08:00
bash install_tools.sh
bash install_docker.sh
2023-09-19 15:40:14 +08:00
2023-09-19 17:44:20 +08:00
# Install Cockpit and plugins
2023-09-19 18:30:33 +08:00
bash install_cockpit.sh
bash install_plugins.sh
2023-09-19 15:40:14 +08:00
2023-09-19 19:55:23 +08:00
# Install backend services
2023-09-19 18:12:37 +08:00
cd $install_path/docker
2023-09-19 17:44:20 +08:00
sudo docker network create websoft9
2023-09-19 18:30:33 +08:00
sudo docker compose -p websoft9 up -d
2023-09-19 15:40:14 +08:00
2023-09-19 17:44:20 +08:00
# Install Systemd service
2023-09-19 19:55:23 +08:00
cp $install_path/systemd/websoft9.service /lib/systemd/system/
2023-09-19 18:12:37 +08:00
sudo systemctl daemon-reload
sudo systemctl enable websoft9.service
sudo systemctl start websoft9