html-tower/.woodpecker/deploy.sh

22 lines
492 B
Bash
Raw Normal View History

2024-05-22 16:47:54 +00:00
#!/bin/sh -e
host=root@oxaliq.net
targetdir=/var/www/art.oxaliq.net/html-tower
echo "COPYING FILES TO DEPLOYMENT TARGET"
scp -r src "$host":~/html-tower
echo "SETTING OWNERSHIP AND PERMISSIONS"
ssh $host 'chown -R www-data:www-data html-tower/'
ssh $host 'chown -R 755 html-tower'
echo "REPLACING PREVIOUS DEPLOYMENT"
ssh $host "rm -rf $targetdir || true"
ssh $host "mv html-tower $targetdir"
echo "RESTARTING SERVICE"
ssh $host 'systemctl restart nginx.service'
echo "SUCCESS!"
exit 0