Add actual task implementations

This commit is contained in:
Luke Murphy 2020-02-11 14:27:48 +01:00
parent 7a7543bf33
commit b1c37bdb08
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

26
fabfile.py vendored
View File

@ -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')