Major upgrades (could use more testing)
- Python 3 (only) - Django 1.9 - Upgrade frontend deps - Improve static file handling
This commit is contained in:
1 parent
43bde435b7
commit
b6bc69ec5d
381 files changed
+22767
-79115
No files matched your search
Vendored
+1
-38
@@ -1,9 +1,5 @@
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from contextlib import contextmanager as _contextmanager
|
||||
from fabric.api import run, sudo, env, cd, prefix, lcd
|
||||
from fabric.api import local as lrun
|
||||
|
||||
env.use_ssh_config = True
|
||||
env.hosts = ['dreamcast.neuf.no']
|
||||
@@ -19,44 +15,11 @@ def virtualenv():
|
||||
yield
|
||||
|
||||
|
||||
def __git_validate_clean():
|
||||
with lcd(env.project_path):
|
||||
if lrun('git diff-files', capture=True) != '':
|
||||
logging.error("Your git-tree isn't clean! Commit your changes before deploying.")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def test():
|
||||
lrun("python manage.py test dpdapi")
|
||||
|
||||
|
||||
def commit():
|
||||
lrun("git add -p && git commit")
|
||||
|
||||
|
||||
def push():
|
||||
lrun("git push")
|
||||
|
||||
|
||||
def prepare_deploy():
|
||||
test()
|
||||
commit()
|
||||
push()
|
||||
|
||||
|
||||
def gitstatus():
|
||||
# __git_validate_clean()
|
||||
with virtualenv():
|
||||
# Get source
|
||||
run('git branch -v')
|
||||
|
||||
|
||||
def deploy():
|
||||
# __git_validate_clean()
|
||||
with virtualenv():
|
||||
run('git pull') # Get source
|
||||
run('pip install -r requirements.txt') # install deps in virtualenv
|
||||
run('umask 002; python manage.py collectstatic --noinput') # Collect static
|
||||
run('python manage.py collectstatic --noinput') # Collect static
|
||||
run('python manage.py migrate') # Run DB migrations
|
||||
|
||||
# Reload gunicorn
|
||||
|
||||
Reference in new issue
Block a user