add deploy

This commit is contained in:
SimonFJ20 2025-03-07 10:02:49 +01:00
parent b3246c9a3e
commit 9b92536bbd
4 changed files with 54 additions and 0 deletions

12
deploy/h4backend.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=H4 Backend
[Service]
Type=simple
#User=
#Group=
ExecStart=/home/host/h4-projekt-gruppe-0-sm/backend/build/server
Restart=on-failure
[Install]
WantedBy=default.target

14
deploy/install_service.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
SERVICE=h4backend.service
set -xe
sudo cp deploy/$SERVICE /etc/systemd/user/$SERVICE
systemctl --user daemon-reload
systemctl --user enable $SERVICE
systemctl --user start $SERVICE

15
deploy/redeploy.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
SERVICE=h4backend.service
set -xe
git pull --rebase
cd backend
make clean
make RELEASE=1
cd ..
systemctl --user restart $SERVICE

13
deploy/remove_service.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
SERVICE=h4backend.service
set -xe
systemctl --user stop $SERVICE
systemctl --user disable $SERVICE
sudo rm /etc/systemd/user/$SERVICE