websoft9/install/install_new.sh

33 lines
785 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 18:12:37 +08:00
# Define vars
install_path="/data/websoft9"
2023-09-19 15:40:14 +08:00
urls="https://w9artifact.blob.core.windows.net/release/websoft9"
if [[ "$1" == "dev" ]]; then
2023-09-19 18:12:37 +08:00
echo "update by dev artifact"
2023-09-19 15:40:14 +08:00
urls="https://w9artifact.blob.core.windows.net/dev/websoft9"
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 17:44:20 +08:00
# Install backend service
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 18:30:33 +08:00
cd $install_path/systemd
2023-09-19 18:12:37 +08:00
sudo systemctl daemon-reload
sudo systemctl enable websoft9.service
sudo systemctl start websoft9