oxaliq.net/.woodpecker/deploy.sh
maren 016b945815
All checks were successful
ci/woodpecker/push/build-and-deploy Pipeline was successful
maren/more-ci-work (#4)
starting to establish a reusable pattern for ssh+deploy.sh from woodpecker for deployments to turtle

after this PR is merged i'll document here: https://wiki.bunk.computer/hypha/ci_-_woodpecker

Reviewed-on: oxaliq/sorrel.dev#4
Co-authored-by: maren <git@stillgreenmoss.net>
Co-committed-by: maren <git@stillgreenmoss.net>
2024-01-08 15:23:08 +00:00

32 lines
815 B
Bash
Executable file

#!/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/.
# 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 'sudo chown -R sorreldotdev:sorreldotdev oxaliq/'
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"
ssh $host 'sudo systemctl restart sorreldotdev.service'
echo "SUCCESS!"
exit 0