import os

import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, PROJECT_NAME = helpers.get_app_dirs(__file__)

if settings.ZAMBONI_DIR:
    helpers.scl_enable("python27")
    ZAMBONI = "%s/zamboni" % settings.ZAMBONI_DIR
    ZAMBONI_PYTHON = "%s/venv/bin/python" % settings.ZAMBONI_DIR

os.environ["DJANGO_SETTINGS_MODULE"] = "settings_local_mkt"


@task
def pre_update(ref):
    with lcd(PROJECT_NAME):
        local("git fetch")
        local("git fetch -t")
        local("git reset --hard %s" % ref)


@task
def build():
Пример #2
0
import os
from os.path import join as pjoin

from fabric.api import (env, execute, lcd, local, parallel, run, roles, task)

import fabdeploytools.envs
from fabdeploytools import helpers

import deploysettings as settings

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings_local_mkt'

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, ZAMBONI = helpers.get_app_dirs(__file__)

VIRTUALENV = pjoin(ROOT, 'venv')
PYTHON = pjoin(VIRTUALENV, 'bin', 'python')


def managecmd(cmd):
    with lcd(ZAMBONI):
        local('%s manage.py %s' % (PYTHON, cmd))


@task
def create_virtualenv(update_on_change=False):
    helpers.create_venv(VIRTUALENV,
                        settings.PYREPO,
                        pjoin(ZAMBONI, 'requirements/prod.txt'),
Пример #3
0
import os
from fabric.api import (env, execute, lcd, local, parallel, run, roles, task)

from fabdeploytools import helpers
import fabdeploytools.envs

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

SCL_NAME = getattr(settings, 'SCL_NAME', False)
if SCL_NAME:
    helpers.scl_enable(SCL_NAME)

ROOT, WEBPAY = helpers.get_app_dirs(__file__)

VIRTUALENV = os.path.join(ROOT, 'venv')
PYTHON = os.path.join(VIRTUALENV, 'bin', 'python')


def managecmd(cmd):
    with lcd(WEBPAY):
        local('%s manage.py %s' % (PYTHON, cmd))


@task
def create_virtualenv():
    helpers.create_venv(VIRTUALENV,
                        settings.PYREPO,
                        '%s/requirements/prod.txt' % WEBPAY,
Пример #4
0
import os
from os.path import join as pjoin
from fabric.api import (env, execute, lcd, local, parallel, run, roles, task)

from fabdeploytools.rpm import RPMBuild
from fabdeploytools import helpers
import fabdeploytools.envs

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, ADDON_REGISTRATION = helpers.get_app_dirs(__file__)

SCL_NAME = getattr(settings, 'SCL_NAME', False)
if SCL_NAME:
    helpers.scl_enable(SCL_NAME)

VIRTUALENV = os.path.join(ROOT, 'venv')
PYTHON = os.path.join(VIRTUALENV, 'bin', 'python')


@task
def create_virtualenv(update_on_change=False):
    helpers.create_venv(VIRTUALENV,
                        settings.PYREPO,
                        pjoin(ADDON_REGISTRATION, 'requirements/prod.txt'),
                        update_on_change=update_on_change)

Пример #5
0
import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)
ROOT, DARJEELING = helpers.get_app_dirs(__file__)


@task
def pre_update(ref):
    with lcd(DARJEELING):
        local('git fetch')
        local('git fetch -t')
        local('git reset --hard %s' % ref)


@task
def update():
    with lcd(DARJEELING):
        local('npm install grunt-cli')
        local('npm install')
        local('cp -f settings_local.js.dist settings_local.js')
        local('cp -f ./src/lite/media/js/settings_local.js.dist '
              './src/lite/media/js/settings_local.js')
        local('./node_modules/grunt-cli/bin/grunt minify')


@task
Пример #6
0
import os

import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)
ROOT, FIREPLACE = helpers.get_app_dirs(__file__)
COMMONPLACE = '%s/node_modules/commonplace/bin/commonplace' % FIREPLACE


@task
def pre_update(ref):
    with lcd(FIREPLACE):
        local('git fetch')
        local('git fetch -t')
        local('git reset --hard %s' % ref)


@task
def update():
    with lcd(FIREPLACE):
        local('npm install')
        local('npm install --force [email protected]')
        local('%s includes' % COMMONPLACE)
        local('%s langpacks' % COMMONPLACE)

Пример #7
0
import os

import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)
ROOT, SPARTACUS = helpers.get_app_dirs(__file__)


@task
def pre_update(ref):
    with lcd(SPARTACUS):
        local('git fetch')
        local('git fetch -t')
        local('git reset --hard %s' % ref)


@task
def update():
    with lcd(SPARTACUS):
        local('npm install')
        local('node -e "require(\'grunt\').cli()" null abideCompile')
        local('node -e "require(\'grunt\').cli()" null stylus')
        local('node -e "require(\'grunt\').cli()" null requirejs')
        local('node -e "require(\'grunt\').cli()" null nunjucks')

Пример #8
0
import os

import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)
ROOT, DISCOPLACE = helpers.get_app_dirs(__file__)

COMMONPLACE = '%s/node_modules/commonplace/bin' % DISCOPLACE

os.environ["PATH"] += os.pathsep + os.pathsep.join([COMMONPLACE])


@task
def pre_update(ref):
    with lcd(DISCOPLACE):
        local('git fetch')
        local('git fetch -t')
        local('git reset --hard %s' % ref)


@task
def update():
    with lcd(DISCOPLACE):
        local('npm install')
        local('npm install --force [email protected]')
        local('commonplace includes')
Пример #9
0
from fabdeploytools import helpers
import fabdeploytools.envs

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

SCL_NAME = getattr(settings, 'SCL_NAME', False)
if SCL_NAME:
    helpers.scl_enable(SCL_NAME)

IS_PROXY = getattr(settings, 'IS_PROXY', False)

ROOT, SOLITUDE = helpers.get_app_dirs(__file__)
VIRTUALENV = pjoin(ROOT, 'venv')
PYTHON = pjoin(VIRTUALENV, 'bin', 'python')


@task
def create_virtualenv():
    venv = VIRTUALENV
    if venv.startswith(pjoin('/data', 'src', settings.CLUSTER)):
        local('rm -rf %s' % venv)

    helpers.create_venv(VIRTUALENV, settings.PYREPO,
                        pjoin(SOLITUDE, 'requirements/prod.txt'))


@task
Пример #10
0
import os.path
from os.path import join as pjoin

from fabric.api import env, execute, lcd, local, task

from fabdeploytools import helpers
import fabdeploytools.envs

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

IS_PROXY = getattr(settings, 'IS_PROXY', False)

ROOT, SOLITUDE = helpers.get_app_dirs(__file__)
VIRTUALENV = pjoin(ROOT, 'venv')
PYTHON = pjoin(VIRTUALENV, 'bin', 'python')


@task
def create_virtualenv():
    venv = VIRTUALENV
    if venv.startswith(pjoin('/data', 'src', settings.CLUSTER)):
        local('rm -rf %s' % venv)

    helpers.create_venv(VIRTUALENV, settings.PYREPO,
                        pjoin(SOLITUDE, 'requirements/prod.txt'))


@task
Пример #11
0
import os

import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)
ROOT, APP = helpers.get_app_dirs(__file__)

if not os.environ.get('HOME'):
    os.environ['HOME'] = '/tmp'


@task
def pre_update(ref):
    with lcd(APP):
        local('git fetch')
        local('git fetch -t')
        local('git reset --hard %s' % ref)


@task
def update():
    with lcd(APP):
        local('npm install')


@task
Пример #12
0
import os
from os.path import join as pjoin
from fabric.api import (env, execute, lcd, local, parallel,
                        run, roles, task)

from fabdeploytools.rpm import RPMBuild
from fabdeploytools import helpers
import fabdeploytools.envs

import deploysettings as settings


env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, ADDON_REGISTRATION = helpers.get_app_dirs(__file__)

VIRTUALENV = os.path.join(ROOT, 'venv')
PYTHON = os.path.join(VIRTUALENV, 'bin', 'python')


@task
def create_virtualenv(update_on_change=False):
    helpers.create_venv(VIRTUALENV, settings.PYREPO,
                        pjoin(ADDON_REGISTRATION, 'requirements/prod.txt'),
                        update_on_change=update_on_change)


@task
def setup_install():
    with lcd(ADDON_REGISTRATION):
import os

import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, PROJECT_NAME = helpers.get_app_dirs(__file__)

if settings.ZAMBONI_DIR:
    helpers.scl_enable('python27')
    ZAMBONI = '%s/zamboni' % settings.ZAMBONI_DIR
    ZAMBONI_PYTHON = '%s/venv/bin/python' % settings.ZAMBONI_DIR

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings_local_mkt'


@task
def pre_update(ref):
    with lcd(PROJECT_NAME):
        local('git fetch')
        local('git fetch -t')
        local('git reset --hard %s' % ref)


@task
def update():
Пример #14
0
import os

import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, YOGAFIRE = helpers.get_app_dirs(__file__)

ZAMBONI = '%s/zamboni' % settings.ZAMBONI_DIR
ZAMBONI_PYTHON = '%s/venv/bin/python' % settings.ZAMBONI_DIR

COMMONPLACE = '%s/node_modules/commonplace/bin' % YOGAFIRE
GRUNT = '%s/node_modules/grunt-cli/bin' % YOGAFIRE

YOGAFIRE_PACKAGE = '%s/package/archives/latest_%s.zip' % (YOGAFIRE,
                                                          settings.ENV)

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings_local_mkt'
os.environ["PATH"] += os.pathsep + os.pathsep.join([COMMONPLACE, GRUNT])


@task
def pre_update(ref):
    with lcd(YOGAFIRE):
        local('git fetch')
        local('git fetch -t')
Пример #15
0
import os
from fabric.api import (env, execute, lcd, local, parallel,
                        run, roles, task)

from fabdeploytools import helpers
import fabdeploytools.envs

import deploysettings as settings


env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, GEODUDE = helpers.get_app_dirs(__file__)

VIRTUALENV = os.path.join(ROOT, 'venv')
PYTHON = os.path.join(VIRTUALENV, 'bin', 'python')
GEOIP_DB = '/usr/share/GeoIP/GeoIP2-City.mmdb'


def managecmd(cmd):
    with lcd(GEODUDE):
        local('%s manage.py %s' % (PYTHON, cmd))


@task
def create_virtualenv():
    helpers.create_venv(VIRTUALENV, settings.PYREPO,
                        '%s/requirements/prod.txt' % GEODUDE,
                        update_on_change=True, rm_first=True)
Пример #16
0
import os
from fabric.api import (env, execute, lcd, local, parallel,
                        run, roles, task)

from fabdeploytools.rpm import RPMBuild
from fabdeploytools import helpers
import fabdeploytools.envs

import deploysettings as settings


env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, WEBPAY = helpers.get_app_dirs(__file__)

VIRTUALENV = os.path.join(ROOT, 'venv')
PYTHON = os.path.join(VIRTUALENV, 'bin', 'python')


def managecmd(cmd):
    with lcd(WEBPAY):
        local('%s manage.py %s' % (PYTHON, cmd))


@task
def create_virtualenv():
    with lcd(WEBPAY):
        # Compare the last reflog change with the latest change we introduced.
        status = local('git diff HEAD@{1} HEAD --name-only', capture=True)
Пример #17
0
import os
from os.path import join as pjoin

from fabric.api import (env, execute, lcd, local, parallel,
                        run, roles, task)

import fabdeploytools.envs
from fabdeploytools import helpers

import deploysettings as settings


env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, OLYMPIA = helpers.get_app_dirs(__file__)

VIRTUALENV = pjoin(ROOT, 'venv')
PYTHON = pjoin(VIRTUALENV, 'bin', 'python')


def managecmd(cmd):
    with lcd(OLYMPIA):
        local('%s manage.py %s' % (PYTHON, cmd))


@task
def create_virtualenv(update_on_change=False):
    helpers.create_venv(VIRTUALENV, settings.PYREPO,
                        pjoin(OLYMPIA, 'requirements/prod.txt'),
                        update_on_change=update_on_change)
Пример #18
0
import os

import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, YOGAFIRE = helpers.get_app_dirs(__file__)

ZAMBONI = '%s/zamboni' % settings.ZAMBONI_DIR
ZAMBONI_PYTHON = '%s/venv/bin/python' % settings.ZAMBONI_DIR

COMMONPLACE = '%s/node_modules/commonplace/bin' % YOGAFIRE
GRUNT = '%s/node_modules/grunt-cli/bin' % YOGAFIRE

YOGAFIRE_PACKAGE = '%s/package/archives/latest_%s.zip' % (YOGAFIRE,
                                                          settings.ENV)

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings_local_mkt'
os.environ["PATH"] += os.pathsep + os.pathsep.join([COMMONPLACE, GRUNT])


@task
def pre_update(ref):
    with lcd(YOGAFIRE):
        local('git fetch')
        local('git fetch -t')
Пример #19
0
import os
from os.path import join as pjoin
from fabric.api import (env, execute, lcd, local, parallel,
                        run, roles, task)

from fabdeploytools.rpm import RPMBuild
from fabdeploytools import helpers
import fabdeploytools.envs

import deploysettings as settings


env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, TRUNION = helpers.get_app_dirs(__file__)

SCL_NAME = getattr(settings, 'SCL_NAME', False)
if SCL_NAME:
    helpers.scl_enable(SCL_NAME)

VIRTUALENV = os.path.join(ROOT, 'venv')
PYTHON = os.path.join(VIRTUALENV, 'bin', 'python')


@task
def create_virtualenv(update_on_change=False):
    helpers.create_venv(VIRTUALENV, settings.PYREPO,
                        pjoin(TRUNION, 'prod-reqs.txt'),
                        update_on_change=update_on_change)
Пример #20
0
from os.path import join as pjoin
from fabric.api import env, execute, lcd, local, task
from fabdeploytools import helpers
import fabdeploytools.envs
import deploysettings as settings
import ConfigParser
import time

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, MONOLITH = helpers.get_app_dirs(__file__)

VIRTUALENV = pjoin(ROOT, 'venv')
PYTHON = pjoin(VIRTUALENV, 'bin', 'python')

config = ConfigParser.ConfigParser()
config.readfp(open('aggregator.ini'))


@task
def create_virtualenv():
    helpers.create_venv(VIRTUALENV, settings.PYREPO,
                        pjoin(MONOLITH, 'requirements/prod.txt'))


@task
def deploy():
    helpers.deploy(
        name='monolith-aggregator',
        env=settings.ENV,
Пример #21
0
import os

import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)
ROOT, FIREPLACE = helpers.get_app_dirs(__file__)

COMMONPLACE = '%s/node_modules/commonplace/bin' % FIREPLACE
GRUNT = '%s/node_modules/grunt-cli/bin' % FIREPLACE

if settings.ZAMBONI_DIR:
    ZAMBONI = '%s/zamboni' % settings.ZAMBONI_DIR
    ZAMBONI_PYTHON = '%s/venv/bin/python' % settings.ZAMBONI_DIR
    FIREPLACE_PACKAGE = '%s/package/archives/latest_%s.zip' % (FIREPLACE,
                                                               settings.ENV)

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings_local_mkt'
os.environ["PATH"] += os.pathsep + os.pathsep.join([COMMONPLACE, GRUNT])


@task
def pre_update(ref):
    with lcd(FIREPLACE):
        local('git fetch')
        local('git fetch -t')
        local('git reset --hard %s' % ref)
Пример #22
0
from os.path import join as pjoin

from fabric.api import env, execute, lcd, local, task

from fabdeploytools import helpers
import fabdeploytools.envs

import deploysettings as settings


env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, MONOLITH = helpers.get_app_dirs(__file__)

VIRTUALENV = pjoin(ROOT, 'venv')
PYTHON = pjoin(VIRTUALENV, 'bin', 'python')


@task
def create_virtualenv():
    helpers.create_venv(VIRTUALENV, settings.PYREPO,
                        pjoin(MONOLITH, 'requirements/prod.txt'))


@task
def deploy():
    helpers.deploy(
        name='monolith',
        env=settings.ENV,
        cluster=settings.CLUSTER,
Пример #23
0
import os
from os.path import join as pjoin

from fabric.api import env, execute, lcd, local, parallel, run, roles, task

import fabdeploytools.envs
from fabdeploytools import helpers

import deploysettings as settings

os.environ["DJANGO_SETTINGS_MODULE"] = "settings_local_mkt"

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, ZAMBONI = helpers.get_app_dirs(__file__)

VIRTUALENV = pjoin(ROOT, "venv")
PYTHON = pjoin(VIRTUALENV, "bin", "python")


def managecmd(cmd):
    with lcd(ZAMBONI):
        local("%s manage.py %s" % (PYTHON, cmd))


@task
def create_virtualenv(update_on_change=False):
    helpers.create_venv(
        VIRTUALENV, settings.PYREPO, pjoin(ZAMBONI, "requirements/prod.txt"), update_on_change=update_on_change
    )
Пример #24
0
import os
from os.path import join as pjoin
from fabric.api import (env, execute, lcd, local, parallel, run, roles, task)

from fabdeploytools.rpm import RPMBuild
from fabdeploytools import helpers
import fabdeploytools.envs

import deploysettings as settings

env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)

ROOT, TRUNION = helpers.get_app_dirs(__file__)

SCL_NAME = getattr(settings, 'SCL_NAME', False)
if SCL_NAME:
    helpers.scl_enable(SCL_NAME)

VIRTUALENV = os.path.join(ROOT, 'venv')
PYTHON = os.path.join(VIRTUALENV, 'bin', 'python')


@task
def create_virtualenv(update_on_change=False):
    helpers.create_venv(VIRTUALENV,
                        settings.PYREPO,
                        pjoin(TRUNION, 'prod-reqs.txt'),
                        update_on_change=update_on_change)