Merge lp:~michael.nelson/charms/trusty/kibana/trunk into lp:~canonical-is-sa/charms/trusty/kibana/trunk

Proposed by Michael Nelson
Status: Merged
Merged at revision: 20
Proposed branch: lp:~michael.nelson/charms/trusty/kibana/trunk
Merge into: lp:~canonical-is-sa/charms/trusty/kibana/trunk
Diff against target: 164 lines (+74/-11)
8 files modified
config.yaml (+9/-1)
hooks/config-changed (+18/-0)
hooks/install (+7/-2)
hooks/start (+1/-3)
hooks/stop (+3/-2)
hooks/web-relation-joined (+3/-2)
metadata.yaml (+1/-1)
tests/12-port-change.py (+32/-0)
To merge this branch: bzr merge lp:~michael.nelson/charms/trusty/kibana/trunk
Reviewer Review Type Date Requested Status
Michael Foley (community) Approve
Review via email: mp+275947@code.launchpad.net

Commit message

Merge upstream (which now has web-relation-joined http relation).
Fixed conflicts.
Fixed charm proof errors.

Description of the change

This branch just re-merges the upstream lp:charms/trusty/kibana and resolves the conflicts (main one being that upstream still uses 'web' rather than 'website', even though it's changed the type to 'http').

Once this is merged, we should be able to ask for this MP to be merged upstream:

https://code.launchpad.net/~canonical-is-sa/charms/trusty/kibana/trunk/+merge/260026

so that the exec.d support and elasticsearch url support gets added upstream.

I'm just testing this now with a local deploy.

To post a comment you must log in.
Revision history for this message
Michael Foley (foli) wrote :

This looks good.

review: Approve

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-26 03:45:25 +0000
+++ config.yaml 2015-10-28 04:20:49 +0000
@@ -11,8 +11,16 @@
11 type: string11 type: string
12 default: '74c6b8b79d1bfc7e4d5376e3c9ecb0fa1e79c986'12 default: '74c6b8b79d1bfc7e4d5376e3c9ecb0fa1e79c986'
13 description: the sha1sum of the kibana_source13 description: the sha1sum of the kibana_source
14 port:
15 type: int
16 default: 80
17 description: The tcp port on which nginx will listen.
18 path:
19 type: string
20 default: ''
21 description: 'The url path of kibana. This is required if kibana is
22 proxied at a non root path. e.g. http://example.com/kibana/'
14 elasticsearch_url:23 elasticsearch_url:
15 type: string24 type: string
16 default: '"http://"+window.location.hostname'25 default: '"http://"+window.location.hostname'
17 description: URL to for elasticsearch line in config.sh, defaults to '"http://"+window.location.hostname'26 description: URL to for elasticsearch line in config.sh, defaults to '"http://"+window.location.hostname'
18
1927
=== added file 'hooks/config-changed'
--- hooks/config-changed 1970-01-01 00:00:00 +0000
+++ hooks/config-changed 2015-10-28 04:20:49 +0000
@@ -0,0 +1,18 @@
1#!/bin/bash
2set -eux
3
4PORT=$(config-get port)
5KIBANA_PATH=$(config-get path)
6
7sed -i "s/listen.*/listen *:$PORT;/" /etc/nginx/sites-available/kibana
8
9sed -i "s@elasticsearch: .*@elasticsearch: '//'+window.location.hostname+'$KIBANA_PATH',@" /srv/kibana3/config.js
10
11service nginx reload
12
13[[ -r .PREVOPENPORT ]] && PREVOPENPORT=$(cat .PREVOPENPORT) || PREVOPENPORT=''
14[[ -z "$PREVOPENPORT" ]] || close-port $PREVOPENPORT/tcp
15
16open-port $PORT/tcp
17echo $PORT > .PREVOPENPORT
18
019
=== modified file 'hooks/install'
--- hooks/install 2015-04-21 00:28:13 +0000
+++ hooks/install 2015-10-28 04:20:49 +0000
@@ -31,8 +31,10 @@
3131
32pushd /srv32pushd /srv
3333
34tar xzvf /tmp/kibana.tgz34if [[ ! -d kibana3 ]]; then
35mv ${KIBANA_SOURCE_UNPACK_DIRECTORY} kibana335 tar xzvf /tmp/kibana.tgz
36 mv ${KIBANA_SOURCE_UNPACK_DIRECTORY} kibana3
37fi
3638
37rm -f /etc/nginx/sites-enabled/default39rm -f /etc/nginx/sites-enabled/default
3840
@@ -40,9 +42,12 @@
4042
41rm -f /srv/kibana3/config.js43rm -f /srv/kibana3/config.js
42install -o root -g root -m 0644 files/charm/config.js /srv/kibana3/config.js44install -o root -g root -m 0644 files/charm/config.js /srv/kibana3/config.js
45
43# edit the elasticsearch line to be the value of option elasticsearch_url46# edit the elasticsearch line to be the value of option elasticsearch_url
44sed -r -i -e 's|(^\s*elasticsearch:\s*).*$|\1'"${ELASTICSEARCH_URL}"',|' /srv/kibana3/config.js47sed -r -i -e 's|(^\s*elasticsearch:\s*).*$|\1'"${ELASTICSEARCH_URL}"',|' /srv/kibana3/config.js
4548
49hooks/config-changed
50
46ln -s /etc/nginx/sites-available/kibana /etc/nginx/sites-enabled/kibana51ln -s /etc/nginx/sites-available/kibana /etc/nginx/sites-enabled/kibana
47ln -s /etc/nginx/sites-available/es_cluster /etc/nginx/sites-enabled/es_cluster52ln -s /etc/nginx/sites-available/es_cluster /etc/nginx/sites-enabled/es_cluster
4853
4954
=== modified file 'hooks/start'
--- hooks/start 2013-09-29 21:58:50 +0000
+++ hooks/start 2015-10-28 04:20:49 +0000
@@ -3,6 +3,4 @@
3# Note that currently this is run directly after install3# Note that currently this is run directly after install
4# i.e. 'service apache2 start'4# i.e. 'service apache2 start'
55
6initctl start nginx6service nginx start
7#open-port 5601/tcp
8open-port 80/tcp
97
=== modified file 'hooks/stop'
--- hooks/stop 2013-09-29 21:58:50 +0000
+++ hooks/stop 2015-10-28 04:20:49 +0000
@@ -6,5 +6,6 @@
6# balancer to stop sending traffic.6# balancer to stop sending traffic.
7# rm /srv/webroot/server-live.txt && sleep 307# rm /srv/webroot/server-live.txt && sleep 30
88
9initctl stop nginx9service nginx stop
10close-port 80/tcp10[[ -r .PREVOPENPORT ]] && PREVOPENPORT=$(cat .PREVOPENPORT) || PREVOPENPORT=''
11[[ -z "$PREVOPENPORT" ]] || close-port $PREVOPENPORT/tcp
1112
=== renamed file 'hooks/website-relation-joined' => 'hooks/web-relation-joined' (properties changed: -x to +x)
--- hooks/website-relation-joined 2015-03-25 02:40:25 +0000
+++ hooks/web-relation-joined 2015-10-28 04:20:49 +0000
@@ -2,7 +2,8 @@
2set -eux2set -eux
3juju-log $JUJU_REMOTE_UNIT joined3juju-log $JUJU_REMOTE_UNIT joined
44
5PORT=$(config-get port)
6
5# Set ip/port for web relation7# Set ip/port for web relation
6relation-set port="80"8relation-set port="$PORT"
7relation-set host=`unit-get private-address`9relation-set host=`unit-get private-address`
8
910
=== modified file 'metadata.yaml'
--- metadata.yaml 2015-03-25 02:40:25 +0000
+++ metadata.yaml 2015-10-28 04:20:49 +0000
@@ -6,7 +6,7 @@
6tags:6tags:
7 - applications 7 - applications
8provides:8provides:
9 website:9 web:
10 interface: http10 interface: http
11requires:11requires:
12 rest:12 rest:
1313
=== added file 'tests/12-port-change.py'
--- tests/12-port-change.py 1970-01-01 00:00:00 +0000
+++ tests/12-port-change.py 2015-10-28 04:20:49 +0000
@@ -0,0 +1,32 @@
1#!/usr/bin/python3
2
3import amulet
4import requests
5
6seconds = 20000
7
8d = amulet.Deployment(series='trusty')
9
10d.add('kibana')
11d.configure('kibana', {'port': 81})
12
13d.expose('kibana')
14
15try:
16 d.setup(timeout=seconds)
17except amulet.helpers.TimeoutError:
18 amulet.raise_status(amulet.SKIP, msg="Environment wasn't stood up in time")
19except:
20 raise
21
22
23def test_web_interface():
24 kibana_unit = d.sentry.unit['kibana/0']
25 url = 'http://%s:81/' % kibana_unit.info['public-address']
26 r = requests.get(url)
27 if not r.ok:
28 amulet.raise_status(amulet.FAIL,
29 msg="Error getting kibana page.")
30
31
32test_web_interface()

Subscribers

People subscribed via source and target branches