コード例 #1
0
ファイル: autoserver.py プロジェクト: paramono/autoserver
def setup_git(**kwargs):
    locals().update(kwargs)

    if skip_git:
        print('* * * Skipping git repo')
        return

    repo_dir = os.path.join(proj_dir, 'repo.git')
    if not os.path.exists(repo_dir) or force_reinit_git:
        print('* * * Creating git bare repo')
        call(['git', 'init', '--bare', repo_dir])
        repo_hooks = os.path.join(repo_dir, 'hooks')

        git_hook = os.path.abspath(
            os.path.join(repo_hooks, 'post-receive'))

        instance_template('git', te_git_hook, git_hook, **args)
        os.chmod(git_hook, 0o755)

        print('\n>>> Run this on your workstation <<<')
        print(
            'git remote add live ssh://{username}@{domain}{repo_dir}'
            .format(username=user, domain=domain, repo_dir=repo_dir)
        )
    else: 
        print('* * * Repo already exists.')
        print('Run with "--force-reinit-git" to reinitialize repo')

    print('\n>>> Run this on your workstation <<<')
    print(
        'git remote add live ssh://{username}@{domain}{repo_dir}'
        .format(username=user, domain=domain, repo_dir=repo_dir)
    )
    print_hr()
コード例 #2
0
ファイル: autoserver.py プロジェクト: paramono/autoserver
def setup_uwsgi(**kwargs):
    locals().update(kwargs)

    if skip_uwsgi:
        print('* * * Skipping uwsgi')
        return

    print("* * * Creating uwsgi configs")

    instance_template('uwsgi', te_uwsgi_emperor, uwsgi_emperor, **kwargs)
    instance_template('uwsgi', te_uwsgi_ini,     uwsgi_ini,     **kwargs)
    print_hr()
コード例 #3
0
ファイル: autoserver.py プロジェクト: paramono/autoserver
def setup_nginx(**kwargs):
    # handle nginx
    locals().update(kwargs)

    if skip_nginx:
        print("\n* * * Skipping nginx")
        return

    if ip and domain: # only if ip and domain present
        print("* * * Creating nginx configs")

        # make some locals available for templates
        # (including absolute paths)
        # required for template rendering 

        # instance the main nginx project config
        instance_template('nginx', te_nginx_conf, nginx_conf, **kwargs)

        # https forcing snippet (commented out)
        copy_template('nginx', te_nginx_https, nginx_https, **kwargs)

        # redirect list snippet (commented out)
        copy_template('nginx', te_nginx_redirects, nginx_redirects, **kwargs)
        print_hr()