update deploy so packages are found

This commit is contained in:
Ronny Abraham 2018-10-18 06:33:23 +03:00
parent a98f1635f4
commit 15ffc7ac8c

View file

@ -7,12 +7,28 @@ from fabric.operations import local
from .utils import virtualenv_source, booleanize, loggify from .utils import virtualenv_source, booleanize, loggify
from .utils import print_console from .utils import print_console
from .utils import link_create
from .nginx import upload as upload_nginx
from .nginx import remove as nginx_remove
from .supervisor import upload as upload_supervisor
from .supervisor import remove as supervisor_remove
from .pip import setup_virtualenv from .pip import setup_virtualenv
from .pip import bootstrap_pip from .pip import bootstrap_pip
from .pip import install as pip_install
from .django import create_project
from .django import generate as django_generate
from .django import collectstatic as django_collectstatic
from . import initialize
from . import docker
from . import database as db
import os import os
import logging import logging
@ -82,7 +98,6 @@ def bootstrap():
bootstrap_pip() bootstrap_pip()
# create the django project # create the django project
from django import create_project
create_project() create_project()
# #
@ -109,8 +124,6 @@ def bootstrap():
# links before creating them, otherwise you get really weird errors # links before creating them, otherwise you get really weird errors
# where the a link is recreated within the destination link # where the a link is recreated within the destination link
from utils import link_create
if env.debug: if env.debug:
logger.debug("virtualenv.root : %s" logger.debug("virtualenv.root : %s"
% configuration.virtualenv.paths.root) % configuration.virtualenv.paths.root)
@ -154,10 +167,6 @@ def bootstrap():
# create and link the scripts that manage the server # create and link the scripts that manage the server
# e.g. nginx, supervisor, gunicorn # e.g. nginx, supervisor, gunicorn
from nginx import upload as upload_nginx
from supervisor import upload as upload_supervisor
from django import generate as django_generate
print_console("creating gunicorn script") print_console("creating gunicorn script")
django_generate('gunicorn', True) django_generate('gunicorn', True)
django_generate('local', True) django_generate('local', True)
@ -171,8 +180,6 @@ def bootstrap():
# #
# instantiate docker containers if any # instantiate docker containers if any
import docker
print_console("check to see if docker containers are used") print_console("check to see if docker containers are used")
if hasattr(configuration, "docker"): if hasattr(configuration, "docker"):
@ -219,15 +226,12 @@ def bootstrap_part1():
@task @task
def bootstrap_part2(): def bootstrap_part2():
import database as db
configuration = env.config configuration = env.config
if env.debug: if env.debug:
logger = loggify('deploy', 'bootstrap') logger = loggify('deploy', 'bootstrap')
# create the django project # create the django project
from django import create_project
create_project() create_project()
# #
@ -254,8 +258,6 @@ def bootstrap_part2():
# links before creating them, otherwise you get really weird errors # links before creating them, otherwise you get really weird errors
# where the a link is recreated within the destination link # where the a link is recreated within the destination link
from utils import link_create
if env.debug: if env.debug:
logger.debug("virtualenv.root : %s" logger.debug("virtualenv.root : %s"
% configuration.virtualenv.paths.root) % configuration.virtualenv.paths.root)
@ -299,10 +301,6 @@ def bootstrap_part2():
# create and link the scripts that manage the server # create and link the scripts that manage the server
# e.g. nginx, supervisor, gunicorn # e.g. nginx, supervisor, gunicorn
from nginx import upload as upload_nginx
from supervisor import upload as upload_supervisor
from django import generate as django_generate
print_console("creating gunicorn script") print_console("creating gunicorn script")
django_generate('gunicorn', True) django_generate('gunicorn', True)
django_generate('local', True) django_generate('local', True)
@ -316,8 +314,6 @@ def bootstrap_part2():
# #
# instantiate docker containers if any # instantiate docker containers if any
import docker
print_console("check to see if docker containers are used") print_console("check to see if docker containers are used")
if hasattr(configuration, "docker"): if hasattr(configuration, "docker"):
@ -453,7 +449,6 @@ def sync(full=True, extras=False):
exclude=excludeitems) exclude=excludeitems)
if full: if full:
from pip import install as pip_install
pip_install('--all') pip_install('--all')
# overrides() # overrides()
@ -463,15 +458,10 @@ def sync(full=True, extras=False):
# NOTE: if using full synch # NOTE: if using full synch
if full: if full:
from nginx import upload as upload_nginx
from supervisor import upload as upload_supervisor
from django import generate as django_generate
upload_supervisor() upload_supervisor()
django_generate('gunicorn', True) django_generate('gunicorn', True)
upload_nginx() upload_nginx()
from django import collectstatic as django_collectstatic
django_collectstatic() django_collectstatic()
@ -484,8 +474,6 @@ def media(source_branch):
""" """
configuration = env.config configuration = env.config
import initialize
print("project.branch: %s" % configuration.project.branch) print("project.branch: %s" % configuration.project.branch)
# #
@ -693,14 +681,10 @@ def remove(full=True):
# because otherwise they interfere with this modules version # because otherwise they interfere with this modules version
# of "remove" # of "remove"
from nginx import remove as nginx_remove
from supervisor import remove as supervisor_remove
nginx_remove() nginx_remove()
supervisor_remove() supervisor_remove()
from database import drop_all as db_drop_all db.drop_all()
db_drop_all()
# #
# check to see if the parent directory contains anything else # check to see if the parent directory contains anything else