|
@ -2,55 +2,60 @@ |
|
|
|
|
|
|
|
|
from fabric import task |
|
|
from fabric import task |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task |
|
|
@task |
|
|
def doesitsparkjoy(c): |
|
|
def offline(c): |
|
|
"""Release doesitsparkjoy.voicegardens.org.""" |
|
|
"""Release offline.voicegardens.org.""" |
|
|
print('Releasing doesitsparkjoy.voicegardens.org ...') |
|
|
print("Releasing offline.voicegardens.org ...") |
|
|
with c.cd('/var/www/doesitsparkjoy.voicegardens.org'): |
|
|
with c.cd("/var/www/offline.voicegardens.org"): |
|
|
c.run('git pull origin master') |
|
|
c.run("git pull origin main") |
|
|
c.run('sudo supervisorctl restart apps:doesitsparkjoy') |
|
|
c.run("sudo supervisorctl restart apps:offline") |
|
|
c.run('sudo systemctl restart nginx') |
|
|
c.run("sudo systemctl restart nginx") |
|
|
print('Released <3') |
|
|
print("Released <3") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task |
|
|
@task |
|
|
def voicegardens(c): |
|
|
def voicegardens(c): |
|
|
"""Release voicegardens.org.""" |
|
|
"""Release voicegardens.org.""" |
|
|
print('Releasing voicegardens.org ...') |
|
|
print("Releasing voicegardens.org ...") |
|
|
with c.cd('/var/www/voicegardens.org'): |
|
|
with c.cd("/var/www/voicegardens.org"): |
|
|
c.run('git pull origin master') |
|
|
c.run("git pull origin main") |
|
|
c.run('sudo supervisorctl restart apps:voicegardens') |
|
|
c.run("sudo supervisorctl restart apps:voicegardens") |
|
|
c.run('sudo systemctl restart nginx') |
|
|
c.run("sudo systemctl restart nginx") |
|
|
print('Released <3') |
|
|
print("Released <3") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task |
|
|
@task |
|
|
def dailycron(c): |
|
|
def dailycron(c): |
|
|
"""Copy new daily crontab.""" |
|
|
"""Copy new daily crontab.""" |
|
|
print('Copy over new daily crontab ...') |
|
|
print("Copy over new daily crontab ...") |
|
|
# See https://github.com/fabric/fabric/issues/1750 |
|
|
# See https://github.com/fabric/fabric/issues/1750 |
|
|
c.put('./bin/voicegardens-cron-daily', remote='./') |
|
|
c.put("./bin/voicegardens-cron-daily", remote="./") |
|
|
c.sudo('mv voicegardens-cron-daily /etc/cron.daily') |
|
|
c.sudo("mv voicegardens-cron-daily /etc/cron.daily") |
|
|
c.sudo('chown root:root /etc/cron.daily/voicegardens-cron-daily') |
|
|
c.sudo("chown root:root /etc/cron.daily/voicegardens-cron-daily") |
|
|
print('New daily cron in place <3') |
|
|
print("New daily cron in place <3") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task |
|
|
@task |
|
|
def hourlycron(c): |
|
|
def hourlycron(c): |
|
|
"""Copy new hourly crontab.""" |
|
|
"""Copy new hourly crontab.""" |
|
|
print('Copy over new hourly crontab ...') |
|
|
print("Copy over new hourly crontab ...") |
|
|
# See https://github.com/fabric/fabric/issues/1750 |
|
|
# See https://github.com/fabric/fabric/issues/1750 |
|
|
c.put('./bin/voicegardens-cron-hourly', remote='./') |
|
|
c.put("./bin/voicegardens-cron-hourly", remote="./") |
|
|
c.sudo('mv voicegardens-cron-hourly /etc/cron.hourly') |
|
|
c.sudo("mv voicegardens-cron-hourly /etc/cron.hourly") |
|
|
c.sudo('chown root:root /etc/cron.hourly/voicegardens-cron-hourly') |
|
|
c.sudo("chown root:root /etc/cron.hourly/voicegardens-cron-hourly") |
|
|
print('New hourly cron in place <3') |
|
|
print("New hourly cron in place <3") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task |
|
|
@task |
|
|
def cleanarchives(c): |
|
|
def cleanarchives(c): |
|
|
"""Remove all archives.""" |
|
|
"""Remove all archives.""" |
|
|
print('Removing the doesitsparkjoy.voicegardens.org archives ...') |
|
|
print("Removing the offline.voicegardens.org archives ...") |
|
|
with c.cd('/var/www/doesitsparkjoy.voicegardens.org'): |
|
|
with c.cd("/var/www/offline.voicegardens.org"): |
|
|
c.run('rm -rf ./voicegardens/archive/*') |
|
|
c.run("rm -rf ./voicegardens/archive/*") |
|
|
|
|
|
|
|
|
print('Removing the voicegardens.org archives ...') |
|
|
print("Removing the voicegardens.org archives ...") |
|
|
with c.cd('/var/www/voicegardens.org'): |
|
|
with c.cd("/var/www/voicegardens.org"): |
|
|
c.run('rm -rf ./voicegardens/archive/*') |
|
|
c.run("rm -rf ./voicegardens/archive/*") |
|
|
|
|
|
|
|
|
print('Deleted <3') |
|
|
print("Deleted <3") |
|
|