~cf-charmers/charms/trusty/cf-mysql-broker/dev

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: amulet at dummy-user
  • Date: 2014-05-21 06:02:50 UTC
  • Revision ID: amulet@dummy-user.tld-20140521060250-p6ocfbrua0u0hvfd
Some code refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
# vim: et ai ts=4 sw=4:
3
3
import os
4
 
from config import *
 
4
from config import (
 
5
    PACKAGES, SERVICE_USER, JOB_DIR, RUN_DIR, LOG_DIR,
 
6
    SERVICE_DIR, PACKAGES_DIR
 
7
)
5
8
from charmhelpers.fetch import (
6
9
    apt_update, apt_install, filter_installed_packages
7
10
    )
12
15
from charmhelpers.contrib.cloudfoundry.common import (
13
16
    run, chdir, chownr
14
17
)
15
 
from charmhelpers.contrib.cloudfoundry.install import install as helper_install
 
18
 
16
19
 
17
20
def install_broker_package():
18
21
    with chdir(PACKAGES_DIR):
20
23
             'https://github.com/cloudfoundry/cf-mysql-broker.git'])
21
24
    with chdir(os.path.join(PACKAGES_DIR, 'cf-mysql-broker')):
22
25
        run(['bundle'])
23
 
    helper_install(os.path.join(hookenv.charm_dir(), 'files', 'cf-mysql-broker_ctl'),                                                                                    
24
 
                   os.path.join(RUN_DIR, 'cf-mysql-broker_ctl'),
25
 
                   fileprops={'mode': '774', 'owner': 'vcap'})     
26
 
    helper_install(os.path.join(hookenv.charm_dir(), 'files', 'unicorn.conf.rb'),                                                                                    
27
 
                   os.path.join(JOB_DIR, 'config', 'unicorn.conf.rb'),
28
 
                   fileprops={'mode': '664', 'owner': 'vcap'})     
29
 
 
30
 
    
 
26
 
 
27
 
31
28
def install_cf_cli():
32
 
    run(['dpkg', '-i', os.path.join(hookenv.charm_dir(), 'files', 'cf_cli.deb')])                                                                                    
 
29
    run(['dpkg', '-i', os.path.join(hookenv.charm_dir(),
 
30
        'files', 'cf_cli.deb')])
33
31
 
34
32
 
35
33
def install():