21 lines
492 B
Bash
21 lines
492 B
Bash
#!/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
|