Merge lp:~fginther/charms/trusty/adt-result-checker/add-basenode into lp:~canonical-ci-engineering/charms/trusty/adt-result-checker/trunk

Proposed by Francis Ginther
Status: Merged
Approved by: Francis Ginther
Approved revision: 3
Merged at revision: 3
Proposed branch: lp:~fginther/charms/trusty/adt-result-checker/add-basenode
Merge into: lp:~canonical-ci-engineering/charms/trusty/adt-result-checker/trunk
Diff against target: 80 lines (+16/-5)
4 files modified
config.yaml (+5/-0)
hooks/actions.py (+9/-4)
hooks/services.py (+1/-0)
templates/upstart.conf (+1/-1)
To merge this branch: bzr merge lp:~fginther/charms/trusty/adt-result-checker/add-basenode
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+253461@code.launchpad.net

Commit message

Add basenode support and directory layout per IS guidelines.

Description of the change

Add basenode support and directory layout per IS guidelines.

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) :
review: Approve
Revision history for this message
Francis Ginther (fginther) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2015-03-16 17:36:07 +0000
+++ config.yaml 2015-03-19 03:48:56 +0000
@@ -1,4 +1,9 @@
1options:1options:
2 environment:
3 type: string
4 default: "production"
5 description: |
6 Environment (devel, staging, production, etc.) that we're running.
2 config-file:7 config-file:
3 type: string8 type: string
4 description: |9 description: |
510
=== modified file 'hooks/actions.py'
--- hooks/actions.py 2015-03-16 21:14:20 +0000
+++ hooks/actions.py 2015-03-19 03:48:56 +0000
@@ -6,21 +6,26 @@
6from charmhelpers import fetch6from charmhelpers import fetch
7from charmhelpers.core import hookenv7from charmhelpers.core import hookenv
8from charmhelpers.core.host import adduser8from charmhelpers.core.host import adduser
99from charmhelpers.payload import (archive, execd)
10from charmhelpers.payload.archive import extract_tarfile
1110
1211
13REQUIRED_PACKAGES = [12REQUIRED_PACKAGES = [
14 'python-virtualenv', 'python3-dev']13 'python-virtualenv', 'python3-dev']
15SERVICE_DIR = '/srv/adt-result-checker'
1614
17config = hookenv.config()15config = hookenv.config()
1816
17SERVICE_DIR = '/srv/{}/adt-result-checker'.format(config['environment'])
18
1919
20def log_start(service_name):20def log_start(service_name):
21 hookenv.log('adt-result-checker starting')21 hookenv.log('adt-result-checker starting')
2222
2323
24def basenode(service_name):
25 hookenv.log("Executing basenode")
26 execd.execd_preinstall()
27
28
24def install_packages(service_name):29def install_packages(service_name):
25 hookenv.log('Installing dependencies...')30 hookenv.log('Installing dependencies...')
26 fetch.add_source('ppa:canonical-ci-engineering/ci-airline-phase-0')31 fetch.add_source('ppa:canonical-ci-engineering/ci-airline-phase-0')
@@ -33,7 +38,7 @@
33 tarball = os.path.join(files_dir, 'adt-result-checker.tgz')38 tarball = os.path.join(files_dir, 'adt-result-checker.tgz')
34 if not os.path.exists(SERVICE_DIR):39 if not os.path.exists(SERVICE_DIR):
35 hookenv.log('Installing the code for the first time from tarball')40 hookenv.log('Installing the code for the first time from tarball')
36 extract_tarfile(tarball, '/srv/')41 archive.extract_tarfile(tarball, os.path.dirname(SERVICE_DIR))
3742
3843
39def get_config_file(service_name):44def get_config_file(service_name):
4045
=== modified file 'hooks/services.py'
--- hooks/services.py 2015-03-16 17:36:07 +0000
+++ hooks/services.py 2015-03-19 03:48:56 +0000
@@ -14,6 +14,7 @@
14 'service': 'adt-result-checker',14 'service': 'adt-result-checker',
15 'required_data': [config],15 'required_data': [config],
16 'data_ready': [16 'data_ready': [
17 actions.basenode,
17 actions.install_packages,18 actions.install_packages,
18 actions.get_result_checker_from_tarball,19 actions.get_result_checker_from_tarball,
19 actions.install_python_packages,20 actions.install_python_packages,
2021
=== modified file 'templates/upstart.conf'
--- templates/upstart.conf 2015-03-16 21:14:20 +0000
+++ templates/upstart.conf 2015-03-19 03:48:56 +0000
@@ -11,7 +11,7 @@
11# unless it fails 15 times within 5 seconds11# unless it fails 15 times within 5 seconds
12respawn limit 15 512respawn limit 15 5
1313
14env SERVICE_DIR=/srv/adt-result-checker14env SERVICE_DIR=/srv/{{ environment }}/adt-result-checker
1515
16script16script
1717

Subscribers

People subscribed via source and target branches