コード例 #1
0
def _query_solr(base_path, connection, query, directory, start, end, interval):
    with cd(base_path):
        lrun('python local/solr_tasks.py -c {0} -q {1} -d {2} -i {3} -s {4} -e {5}'.format(
            connection,
            query,
            directory,
            interval,
            start,
            end
        ))
コード例 #2
0
ファイル: fabfile.py プロジェクト: UAlbertaALTLab/itwewina
def deploy(tests='run'):
    """
    Tests and ships itwêwina on to Sapir.
    """
    if tests == 'run':
        integration_tests()
    # Fast-forward production's branch to development, and push!
    lrun('git fetch . development:sapir')
    lrun('git push origin sapir:sapir')
    ship_it()
コード例 #3
0
ファイル: fabfile.py プロジェクト: UAlbertaALTLab/itwewina
def integration_tests():
    """
    Run Cypress integration tests. This starts a development server on
    http://localhost:5000, and shuts it down when the tests are done.

    Integrations can ONLY be run locally.
    """
    from fabric.operations import local as lrun

    if env.hosts != ['localhost']:
        abort(red("** can only run integration tests on localhost"))

    with development_server():
        lrun("npm run cypress:run")
コード例 #4
0
def return_pipeline_counts(base_path, directories):
    counts = []
    with cd(base_path):
        for d in directories.split(';'):
            counts.append((d, lrun('ls -l {0} | wc -l'.format(d))))
    for d, c in counts:
        print(blue('{0} contains {1} files'.format(d, c)))
コード例 #5
0
ファイル: fabfile.py プロジェクト: UAlbertaALTLab/itwewina
def provision():
    """
    Provisions (setup for the first time) itwêwina on Sapir.

    This means cloning the repository, setting up the virtualenv, and patching
    the Babel locales.
    """

    require_sapir_or_staging()
    require_itwewina()

    # Clone the repo
    clone_url = lrun('git remote get-url origin', capture=True)
    with cd(env.clone_path):
        run('git clone %s itwewina --branch sapir' % clone_url)

    assert env.itwewina_path.startswith(env.clone_path),\
        'did not find itwewina within the clone path'

    # Setup the virtualenv
    with cd(env.itwewina_path):
        run('virtualenv %s' % env.virtualenv_path)
        with prefix('source %s/bin/activate' % env.virtualenv_path):
            run('pip install -r requirements.txt')

    # Create dummy locales for 'crk'. Python-Babel crashes if these files aren't
    # there, but it doesn't actually use them for anything important ¯\_(ツ)_/¯
    locale_dir = os.path.join(
        env.virtualenv_path, 'lib', 'python2.7', 'site-packages', 'babel', 'locale-data'
    )
    with cd(locale_dir):
        for locale in ('crk', 'crk_Macr', 'crk_Syll'):
            run('cp en_CA.dat %s.dat' % locale)
コード例 #6
0
def _run_pipeline(base_path, workflow, local_config, local_directory, start, end, interval):
    with cd(base_path):
        lrun('python workflow_manager.py -w {0} -d {1} -c {2} -s {3} -e {4} -i {5}'.format(
            workflow, local_directory, local_config, start, end, interval))
コード例 #7
0
def _clear_outputs(base_path, empties):
    # list of directory paths (pipes/cleaned/*)
    with cd(base_path):
        for empty in empties.split(';'):
            lrun('rm -rf %s' % empty)
コード例 #8
0
def help():
    '''Fabfile documentation'''
    lrun('python -c "import fabfile; help(fabfile)"')
コード例 #9
0
def start_weblogic(duser, dpassword, dhostname, dport, cluster):
    '''Start weblogic VM'''
    lrun('''/home/oracle/start.sh -u {0} -p {1} -h {2}:{3} -c {4}'''.format(
        duser, dpassword, dhostname, dport, cluster))
コード例 #10
0
ファイル: __init__.py プロジェクト: frduda/mootiro-maps
def help():
    '''Fabfile documentation'''
    lrun('python -c "import fabfile; help(fabfile)"')
コード例 #11
0
 def run_fabric(self, command):
     from fabric.api import local as lrun
     lrun(command)