ci: use config file dont hardcode db

This commit is contained in:
əlemi 2024-06-08 19:00:00 +02:00
parent 2542c98fe4
commit 8ee67addb6
Signed by: alemi
GPG key ID: A4895B84D311642C

6
.tci
View file

@ -1,18 +1,18 @@
#!/bin/bash #!/bin/bash
echo "building release binary" echo "building release binary"
cargo build --release --all-features -j 1 # limit memory usage cargo build --release --all-features
echo "stopping service" echo "stopping service"
systemctl --user stop upub systemctl --user stop upub
echo "installing new binary" echo "installing new binary"
cp ./target/release/upub /opt/bin/upub cp ./target/release/upub /opt/bin/upub
echo "migrating database" echo "migrating database"
/opt/bin/upub --db "sqlite:///srv/tci/upub.db" --domain https://upub.alemi.dev migrate /opt/bin/upub -c /srv/tci/upub.toml --domain https://upub.alemi.dev migrate
echo "restarting service" echo "restarting service"
systemctl --user start upub systemctl --user start upub
echo "rebuilding frontend" echo "rebuilding frontend"
cd web cd web
CARGO_BUILD_JOBS=1 /opt/bin/trunk build --release --public-url 'https://upub.alemi.dev/web' /opt/bin/trunk build --release --public-url 'https://upub.alemi.dev/web'
echo "deploying frontend" echo "deploying frontend"
rm /srv/http/upub/web/* rm /srv/http/upub/web/*
mv ./dist/* /srv/http/upub/web/ mv ./dist/* /srv/http/upub/web/