예제 #1
0
def step_1():

    bold('Checking Prerequisites')
    call('git --version', error_msg='GIT is not installed.')
    call('svn --version --quiet', error_msg='Subversion is not installed.')
    call('heroku version', error_msg='Heroku is not installed.')

    # Is this the first time?
    if not op.exists('.git'):
        create_git_and_heroku_app()

        info('Waiting 5 seconds for Heroku to finish.')
        time.sleep(5)
        done_msg = '''
-----------------------------------------------------------------------------
You are creating a Heroku app for the first time. Please check the list
of files above, and possible fix them using "git add/rm". When ready
run:
    ./deploy_test.py create_heroku
-----------------------------------------------------------------------------
'''
        
    else:
        done_msg = '''
-----------------------------------------------------------------------------
Above are the changes since your last deployment. Please check them.
Be careful with "git add *" since private face2name keys are not stored 
in Subversion, i.e.: lib/f2n_ca.key.unsecure

When "git status" looks correct, run step two to commit and deploy by
typing: 
    ./deploy_test.py step_2
-----------------------------------------------------------------------------
'''
    call('git add *')
    call('git status')

    bold( done_msg )
예제 #2
0
def create_heroku():
    bold('Pushing files to Heroku')

    commit_msg = 'Subversion rev '+call('svnversion .' ).strip()
    call('git commit -m "{commit_msg}"'.format(commit_msg=commit_msg), ignore_exit_code=True)

    bold('Creating a new app at Heroku.')
    call('heroku create' )
    call('heroku stack:migrate bamboo-ree-1.8.7')

    call('git push heroku master')

    bold('Migrating database at Heroku')
    call('heroku rake db:migrate' )
    
    bold('''
------------------------------------------------------------------------
Done. Type "heroku info" to see where your new heroku application is.
------------------------------------------------------------------------
''')
예제 #3
0
def create_git_and_heroku_app():
    bold('Creating a local GIT repository.')
    call('git init')
    output = call('heroku create')
    print