示例#1
0
def new_app(app):
    host = flask.request.form.get("host")

    apps_conf = AppsConfiguration(deploy_config.get("etcd_environment_url"))
    apps_conf.new(app, host)

    return "ok"
示例#2
0
def app_config_save(app):
    props = flask.request.form.get("props")

    apps_conf = AppsConfiguration(deploy_config.get("etcd_environment_url"))
    apps_conf.save_app(app, props)

    return props
示例#3
0
def delete_app(app):
    apps_conf = AppsConfiguration(deploy_config.get("etcd_environment_url"))
    apps_conf.delete(app)

    return "ok"
示例#4
0
def app_config(app):
    apps_conf = AppsConfiguration(deploy_config.get("etcd_environment_url"))
    return apps_conf.serialize_app(app)
示例#5
0
def page_apps():
    apps_conf = AppsConfiguration(deploy_config.get("etcd_environment_url"))
    conf = apps_conf.get()
    return flask.render_template("configuration.html", section="conf", conf=conf, user=flask.g.get("user"))
示例#6
0
def all_apps():
    apps_conf = AppsConfiguration(deploy_config.get("etcd_environment_url"))
    return flask.jsonify(apps_conf.get())
示例#7
0
    import json as simplejson

import traceback
import flask
from ship.project import ProjectBuilder
from ship.subversion import Subversion
from ship.validator import *
from ship.errors import SVNException, ProjectIdNotFoundException
from commons.apps_configuration import AppsConfiguration
from commons.apps_properties import AppsProperties
from commons.config import Config
from flask import jsonify

config = Config()
deploy_config = config.get('deploy')
apps_conf = AppsConfiguration(deploy_config.get("etcd_environment_url"))
apps_conf.save_todisk()

deploy_app = flask.Blueprint("deploy_app", __name__, template_folder="../templates")

def get_app_acronyms(apps_conf):
    return apps_conf.get_applications()

@deploy_app.route("/", methods=["GET"])
def index():
    apps = get_app_acronyms(apps_conf)
    return flask.render_template("deploy.html", section="deploy", apps=apps, user=flask.g.user)


def create_app_properties_file(app):
    app_properties = AppsProperties(app)