Luke Murphy
5 years ago
3 changed files with 34 additions and 14 deletions
@ -0,0 +1,18 @@ |
|||||
|
"""Deployment with Fabric.""" |
||||
|
|
||||
|
from fabric import task |
||||
|
|
||||
|
@task |
||||
|
def doesitsparkjoy(c): |
||||
|
"""Release doesitsparkjoy.voicegardens.org.""" |
||||
|
print('Releasing doesitsparkjoy.voicegardens.org ...') |
||||
|
with c.cd('/var/www/doesitsparkjoy.voicegardens.org'): |
||||
|
c.run('git pull origin master') |
||||
|
c.run('sudo supervisorctl restart doesitsparkjoy') |
||||
|
c.run('sudo systemctl restart nginx') |
||||
|
print('Released <3') |
||||
|
|
||||
|
@task |
||||
|
def voicegardens(c): |
||||
|
"""Release voicegardens.org.""" |
||||
|
pass # TODO |
@ -1,20 +1,20 @@ |
|||||
PROD_PORT := :9090 |
SERVER := voicegardens.server |
||||
PROD_WORKERS := 4 |
REMOTE_HOST := voicegardens.org |
||||
ARCHIVE_DIR := ./voicegardens/archive |
ARCHIVE_DIR := ./voicegardens/archive |
||||
|
|
||||
default: dev-serve |
default: dev-serve |
||||
|
|
||||
dev-serve: |
dev-serve: |
||||
@FLASK_ENV=development FLASK_APP=voicegardens.server flask run |
@FLASK_ENV=development FLASK_APP=$(SERVER) flask run |
||||
|
|
||||
|
prod-serve: |
||||
|
@gunicorn --workers 1 --bind 9090 $(SERVER):app |
||||
|
|
||||
clear-archive: |
clear-archive: |
||||
@rm -rf $(ARCHIVE_DIR)/* |
@rm -rf $(ARCHIVE_DIR)/* |
||||
|
|
||||
prod-serve: |
doesitsparkjoy: |
||||
@gunicorn --workers $(PROD_WORKERS) --bind $(PROD_PORT) voicegardens.server:app |
@fab -H $(REMOTE_HOST) doesitsparkjoy |
||||
|
|
||||
test-deploy: |
|
||||
@echo 'TODO' |
|
||||
|
|
||||
prod-deploy: |
voicegardens: |
||||
@echo 'TODO' |
@fab -H $(REMOTE_HOST) voicegardens |
||||
|
Loading…
Reference in new issue