diff --git a/bardak.service b/bardak.service new file mode 100644 index 0000000..6a62f1c --- /dev/null +++ b/bardak.service @@ -0,0 +1,15 @@ +[Unit] +Description=Bardak inventory webapp + +[Service] +Type=simple +#User= +#Group= +WorkingDirectory=/home/maybetree/srv/klankschool-bardak +ExecStart=./run.sh +Restart=on-failure +StandardOutput=file:%h/log_file + +[Install] +WantedBy=default.target + diff --git a/build.sh b/build.sh index abd7437..4aa630d 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + git submodule init git submodule update --recursive diff --git a/enable-user-service.sh b/enable-user-service.sh new file mode 100644 index 0000000..f2980b5 --- /dev/null +++ b/enable-user-service.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +systemctl --user enable bardak.service diff --git a/run.sh b/run.sh index e413561..b428b05 100755 --- a/run.sh +++ b/run.sh @@ -1,8 +1,16 @@ #!/bin/sh +set -e + mkdir -p ./data/things mkdir -p ./data/trash +if [ -z "$(podman images -q gateau-cuda11)" ] +then + echo "Container missing, building..." + ./build.sh +fi + podman run \ --name bardak \ --init \ @@ -10,8 +18,8 @@ podman run \ -v ./data/things:/app/things \ -v ./data/trash:/app/trash \ --publish 8085:8085 \ - --detach \ - --restart=always \ + `#--detach` \ + `#--restart=always` \ --replace \ bardak