oxaliq.net/.woodpecker/deploy.sh
oxaliq 0516ba6985
All checks were successful
ci/woodpecker/push/build-and-deploy Pipeline was successful
point ci scripts to the farm
2024-04-16 20:48:01 -04:00

48 lines
1.1 KiB
Bash
Executable file

#!/bin/sh -e
# hello variables
host=root@oxaliq.net
# organize the files
echo "ORGANIZING THE FILES NICELY"
mkdir oxaliq
mv dist oxaliq/.
mv source oxaliq/.
mv static oxaliq/.
# add html cache directories
echo "ADDING HTML CACHE DIRECTORIES"
mkdir fragment
mkdir settled
mkdir unsettled
mkdir tagged
cp -r settled fragment/.
cp -r unsettled fragment/.
cp -r tagged fragment/.
mv fragment oxaliq/static/.
mkdir page
mv settled page/.
mv unsettled page/.
mv tagged page/.
mv page oxaliq/static/.
# put them on the deployment target
echo "COPYING FILES TO DEPLOYMENT TARGET"
scp -r oxaliq "$host":~/
# do everything on the server that's necessary to run the new thing
# TODO make this not remove the old-working version until
# the new version is confirmed working
echo "SETTING OWNERSHIP AND PERMISSIONS"
ssh $host 'chown -R oxaliqdotnet:oxaliqdotnet oxaliq/'
ssh $host 'chmod -R 755 oxaliq/'
echo "REPLACING PREVIOUS DEPLOYMENT"
ssh $host 'rm -rf /srv/oxaliq || true'
ssh $host 'mv oxaliq /srv/.'
echo "RESTARTING SERVICE"
ssh $host 'systemctl restart oxaliqdotnet.service'
echo "SUCCESS!"
exit 0