From b1c37bdb080cb8196ac1b05879d2d2cb2c6e0bb2 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 11 Feb 2020 14:27:48 +0100 Subject: [PATCH] Add actual task implementations --- fabfile.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/fabfile.py b/fabfile.py index a4f6456..e8d5c26 100644 --- a/fabfile.py +++ b/fabfile.py @@ -12,10 +12,34 @@ def doesitsparkjoy(c): c.run('sudo systemctl restart nginx') print('Released <3') +@task +def voicegardens(c): + """Release voicegardens.org.""" + print('Releasing voicegardens.org ...') + with c.cd('/var/www/voicegardens.org'): + c.run('git pull origin master') + c.run('sudo supervisorctl restart voicegardens') + c.run('sudo systemctl restart nginx') + print('Released <3') + +@task +def dailycron(c): + """Copy new crontab.""" + print('Copy over new crontab ...') + # See https://github.com/fabric/fabric/issues/1750 + c.put('./cron/voicegardens', remote='./') + c.sudo('mv voicegardens /etc/cron.daily') + print('New cron in place <3') + @task def cleanarchives(c): - """Release doesitsparkjoy.voicegardens.org.""" + """Remove all archives.""" print('Removing the doesitsparkjoy.voicegardens.org archives ...') with c.cd('/var/www/doesitsparkjoy.voicegardens.org'): c.run('rm -rf ./voicegardens/archive/*') + + print('Removing the voicegardens.org archives ...') + with c.cd('/var/www/voicegardens.org'): + c.run('rm -rf ./voicegardens/archive/*') + print('Deleted <3')