ludo-go/.woodpecker/deploy.sh

31 lines
746 B
Bash
Raw Normal View History

2024-04-30 16:49:06 +00:00
#!/bin/sh -e
host=root@oxaliq.net
# organize files
echo "ORGANIZING THE FILES"
mkdir ludo-go
mv target/release/ludo-go-server ludo-go/.
mv target/release/ludo-go-db ludo-go/.
mv target/release/play-go ludo-go/.
## move the database here
# copy files to deployment target
echo "COPYING FILES TO DEPLOYMENT TARGET"
scp -r ludo-go "$host":~/
echo "SETTING OWNERSHIP AND PERMISSIONS"
ssh $host 'chown -R oxaliqdotnet:oxaliqdotnet ludo-go/'
ssh $host 'chown -R 755 ludo-go/'
## todo ensure new deployment is working prior to removing previous
echo "REPLACING PREVIOUS DEPLOYMENT"
ssh $host 'rm -rf /srv/ludo-go || true'
ssh $host 'mv ludo-go /srv/.'
echo "RESTARTING SERVICE"
ssh $host 'systemctl restart ludogo.service'
echo "SUCCESS!"
exit 0