Exemplo n.º 1
0
def do_available_apps(opts):
    "List available applications"

    apps = available_applications(opts.deploy_settings)
    if apps:
        print 'Available Applications:'
        for app in apps:
            print ' * %s' % app
    else:
        print 'No available applications'
Exemplo n.º 2
0
def get_all_deployed_versions():
    result = []
    apps = available_applications(current_app.config)
    for app in apps:
        appdir = os.path.join(current_app.config.paths.apps, app)
        app_result = {
            'name': app,
            'version': None
        }
        if os.path.isdir(appdir):
            application = Application(app, current_app.config.deploy_config_fn)
            app_result['version'] = application.live_version
        result.append(app_result)
    return jsonify({'applications': result})
Exemplo n.º 3
0
def deploy_app(app):
    if app not in available_applications(current_app.config):
        abort(404)
    if request.method == 'POST':
        log.debug('Request to deploy %s', app)
        if request.form:
            log.debug('Extra arguments: %s', request.form)
        target = request.form.get('target', 'master')
        version = request.form.get('version')
        deploy(app, target, current_app.config.deploy_config_fn, version,
               current_app.config)
        log.info('Version %s of %s successfully deployed', version, app)
    application = Application(app, current_app.config.deploy_config_fn)
    version = application.live_version
    return jsonify({'application': {'name': app, 'version': version}})