2024-01-08 15:23:08 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
# hello variables
|
|
|
|
host=deploy@turtle.hup.is
|
|
|
|
|
|
|
|
# organize the files
|
|
|
|
echo "ORGANIZING THE FILES NICELY"
|
|
|
|
mkdir oxaliq
|
|
|
|
mv dist oxaliq/.
|
|
|
|
mv source oxaliq/.
|
|
|
|
mv static oxaliq/.
|
|
|
|
|
2024-01-18 02:13:56 +00:00
|
|
|
# add html cache directories
|
|
|
|
echo "ADDING HTML CACHE DIRECTORIES"
|
|
|
|
mkdir fragment
|
2024-01-18 18:05:21 +00:00
|
|
|
mkdir settled
|
|
|
|
mkdir unsettled
|
|
|
|
mkdir tagged
|
|
|
|
cp -r settled fragment/.
|
|
|
|
cp -r unsettled fragment/.
|
|
|
|
cp -r tagged fragment/.
|
2024-01-18 02:13:56 +00:00
|
|
|
mv fragment oxaliq/static/.
|
|
|
|
mkdir page
|
2024-01-18 18:05:21 +00:00
|
|
|
mv settled page/.
|
|
|
|
mv unsettled page/.
|
|
|
|
mv tagged page/.
|
2024-01-18 02:13:56 +00:00
|
|
|
mv page oxaliq/static/.
|
|
|
|
|
2024-01-08 15:23:08 +00:00
|
|
|
# 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"
|
2024-01-15 02:23:55 +00:00
|
|
|
ssh $host 'sudo chown -R oxaliqdotnet:oxaliqdotnet oxaliq/'
|
2024-01-08 15:23:08 +00:00
|
|
|
ssh $host 'sudo chmod -R 755 oxaliq/'
|
|
|
|
|
|
|
|
echo "REPLACING PREVIOUS DEPLOYMENT"
|
|
|
|
ssh $host 'sudo rm -rf /srv/oxaliq || true'
|
|
|
|
ssh $host 'sudo mv oxaliq /srv/.'
|
|
|
|
|
|
|
|
echo "RESTARTING SERVICE"
|
2024-01-15 02:23:55 +00:00
|
|
|
ssh $host 'sudo systemctl restart oxaliqdotnet.service'
|
2024-01-08 15:23:08 +00:00
|
|
|
|
|
|
|
echo "SUCCESS!"
|
|
|
|
exit 0
|