~hatch/charms/precise/juju-gui/trunk

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: Francesco Banconi
  • Date: 2013-03-28 16:25:06 UTC
  • mfrom: (36.1.7 juju-gui)
  • Revision ID: francesco.banconi@canonical.com-20130328162506-dgerjn52ye7433w9
Added support for juju-core.

It is now possible to deploy the charm
in a juju-core environment.
The GUI correctly  connects to the juju-core 
API server.

R=gary.poster, bac
CC=
https://codereview.appspot.com/8081043

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    config_json,
40
40
    fetch_api,
41
41
    fetch_gui,
 
42
    legacy_juju,
42
43
    log_hook,
43
44
    get_staging_dependencies,
44
45
    save_or_create_certificates,
49
50
 
50
51
CONFIG_FILES = ('haproxy.conf', 'nginx.conf')
51
52
REPOSITORIES = ('ppa:juju-gui/ppa',)
52
 
DEB_DEPENDENCIES = (
53
 
    'curl', 'haproxy', 'nginx', 'openssl',
54
 
)
 
53
DEB_DEPENDENCIES = ('curl', 'haproxy', 'nginx', 'openssl')
 
54
JUJU_CORE_DEPENDENCIES = ('python-yaml',)
55
55
 
56
56
 
57
57
def get_dependencies():
72
72
def main():
73
73
    config = get_config()
74
74
    get_dependencies()
75
 
    if config.get('staging'):
 
75
    is_legacy_juju = legacy_juju()
 
76
    # juju-core staging is not supported yet.
 
77
    if is_legacy_juju and config.get('staging'):
76
78
        get_staging_dependencies()
77
79
    release_tarball = fetch_gui(
78
80
        config['juju-gui-source'], config['command-log-file'])
81
83
    save_or_create_certificates(
82
84
        config['ssl-cert-path'], config.get('ssl-cert-contents'),
83
85
        config.get('ssl-key-contents'))
84
 
    fetch_api(config['juju-api-branch'])
 
86
    if is_legacy_juju:
 
87
        fetch_api(config['juju-api-branch'])
 
88
    else:
 
89
        cmd_log(apt_get_install(*JUJU_CORE_DEPENDENCIES))
85
90
    setup_services()
86
91
    config_json.set(config)
87
92