added deploy.ssh method, also got rid of override
Changes to be committed: modified: modules/deploy.py modified: modules/initialize.py
This commit is contained in:
parent
328de1596b
commit
9cb2341aaa
2 changed files with 29 additions and 30 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
from fabric.api import env, task
|
from fabric.api import env, task
|
||||||
from fabric.operations import run
|
from fabric.operations import run, local
|
||||||
|
|
||||||
# from fabric.contrib.files import upload_template
|
# from fabric.contrib.files import upload_template
|
||||||
# from utils import print_run
|
# from utils import print_run
|
||||||
|
|
@ -226,7 +226,7 @@ def sync(full=True, extras=False):
|
||||||
command_mkdir_remote = "mkdir -p {remote}".format(remote=remote_dir)
|
command_mkdir_remote = "mkdir -p {remote}".format(remote=remote_dir)
|
||||||
|
|
||||||
excludeitems = (".git", "*.swp", "*.swo", ".DS_Store", "*.pyc", "*.bak",
|
excludeitems = (".git", "*.swp", "*.swo", ".DS_Store", "*.pyc", "*.bak",
|
||||||
"build/*")
|
"build/*", "/extras", "/opt")
|
||||||
|
|
||||||
if env.debug:
|
if env.debug:
|
||||||
print "\n%s debug: %s" % (debug_prefix, env.debug)
|
print "\n%s debug: %s" % (debug_prefix, env.debug)
|
||||||
|
|
@ -293,6 +293,11 @@ def sync(full=True, extras=False):
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# print "remote_dir: %s" % remote_dir
|
||||||
|
# print "local_dir: %s" % local_dir
|
||||||
|
# import sys
|
||||||
|
# sys.exit()
|
||||||
|
|
||||||
run(command_mkdir_remote)
|
run(command_mkdir_remote)
|
||||||
|
|
||||||
rsync_project(remote_dir=remote_dir, local_dir=local_dir,
|
rsync_project(remote_dir=remote_dir, local_dir=local_dir,
|
||||||
|
|
@ -302,7 +307,7 @@ def sync(full=True, extras=False):
|
||||||
from pip import install as pip_install
|
from pip import install as pip_install
|
||||||
pip_install('--all')
|
pip_install('--all')
|
||||||
|
|
||||||
overrides()
|
# overrides()
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
@ -546,26 +551,18 @@ def remove(full=True):
|
||||||
run(command_rm_virtualenv)
|
run(command_rm_virtualenv)
|
||||||
|
|
||||||
|
|
||||||
def overrides():
|
@task
|
||||||
"""
|
def ssh():
|
||||||
this is code for files that have no standard category
|
|
||||||
|
|
||||||
for example, I had to upload and override a static js file to modified with
|
|
||||||
the correct value for the deployment.
|
|
||||||
|
|
||||||
I'm keeping this code here so it will be a bit out of the way of the rest.
|
|
||||||
"""
|
|
||||||
|
|
||||||
configuration = env.config
|
configuration = env.config
|
||||||
|
|
||||||
#
|
if configuration.project.ssh:
|
||||||
# load the module where the custom override code is located
|
cmd_ssh = "ssh {user}@{host} -i {sshkey}".format(
|
||||||
|
user=configuration.project.user,
|
||||||
|
host=configuration.project.host,
|
||||||
|
sshkey=configuration.project.ssh)
|
||||||
|
else:
|
||||||
|
cmd_ssh = "ssh {user}@{host}".format(
|
||||||
|
user=configuration.project.user,
|
||||||
|
host=configuration.project.host)
|
||||||
|
|
||||||
import sys
|
local(cmd_ssh)
|
||||||
sys.path.append(configuration.paths.overrides.modules)
|
|
||||||
import override
|
|
||||||
|
|
||||||
#
|
|
||||||
# call the custom deploy code
|
|
||||||
|
|
||||||
override.deploy(env)
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import os
|
||||||
import fabric.utils
|
import fabric.utils
|
||||||
import maintenance
|
import maintenance
|
||||||
from fabric.api import env, task
|
from fabric.api import env, task
|
||||||
from utils import check_debug
|
|
||||||
|
|
||||||
# from utils import loggify
|
# from utils import loggify
|
||||||
|
|
||||||
|
|
@ -46,6 +45,8 @@ def environment(branchname):
|
||||||
|
|
||||||
env.host_string = env.hosts[0]
|
env.host_string = env.hosts[0]
|
||||||
|
|
||||||
|
env.key_filename = env.config.project.ssh
|
||||||
|
|
||||||
# set database host to the docker_ip
|
# set database host to the docker_ip
|
||||||
|
|
||||||
host = env.config.server.database.host
|
host = env.config.server.database.host
|
||||||
|
|
@ -240,12 +241,13 @@ def get_config(branchname):
|
||||||
config['project']['paths']['root'],
|
config['project']['paths']['root'],
|
||||||
project_home_dir)
|
project_home_dir)
|
||||||
|
|
||||||
# DEBUG REMOVE
|
if 'ssh' in config['project']:
|
||||||
if check_debug(env):
|
dataobject.project.ssh = os.path.join(
|
||||||
import utils
|
dataobject.paths.project.local,
|
||||||
utils.printvar('project.branch', dataobject.project.branch)
|
layout['paths']['extras']['ssh'],
|
||||||
utils.printvar('project.root', dataobject.paths.project.root)
|
config['project']['ssh'])
|
||||||
utils.prompt_continue()
|
else:
|
||||||
|
dataobject.project.ssh = None
|
||||||
|
|
||||||
#
|
#
|
||||||
# these are the locations of the scripts/conf file both remote and local
|
# these are the locations of the scripts/conf file both remote and local
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue