Merge lp:~mthaddon/charms/precise/kibana/download-source into lp:charms/kibana

Proposed by Tom Haddon
Status: Merged
Merged at revision: 7
Proposed branch: lp:~mthaddon/charms/precise/kibana/download-source
Merge into: lp:charms/kibana
Diff against target: 137 lines (+32/-32)
7 files modified
config.yaml (+13/-0)
files/charm/nginx.conf (+1/-1)
hooks/install (+14/-14)
hooks/rest-relation-changed (+1/-4)
hooks/rest-relation-departed (+0/-3)
hooks/rest-relation-joined (+1/-5)
hooks/web-relation-joined (+2/-5)
To merge this branch: bzr merge lp:~mthaddon/charms/precise/kibana/download-source
Reviewer Review Type Date Requested Status
Jacek Nykis (community) Approve
Review via email: mp+196705@code.launchpad.net

Description of the change

Allow us to specify the download source, actually confirm the checksum matches the downloaded source, and remove some spurious comments from hooks. Use /srv for kibana - /usr/share is for architecture-independent (shared) data per FHS.

I've done a test deploy of this charm with the some of the new config options set to confirm it works as expected.

To post a comment you must log in.
Revision history for this message
Jacek Nykis (jacekn) wrote :

Everything looks fine to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'config.yaml'
--- config.yaml 1970-01-01 00:00:00 +0000
+++ config.yaml 2013-11-26 12:56:39 +0000
@@ -0,0 +1,13 @@
1options:
2 kibana_source:
3 type: string
4 default: 'https://download.elasticsearch.org/kibana/kibana/kibana-3.0.0milestone4.tar.gz'
5 description: URL to download the source for kibana
6 kibana_source_unpack_directory:
7 type: string
8 default: 'kibana-3.0.0milestone4'
9 description: the name of the directory the tar.gz will unpack to
10 kibana_source_checksum:
11 type: string
12 default: '3ee5416c8a61fa95ba9280631a66997e'
13 description: the md5sum of the kibana_source
014
=== modified file 'files/charm/nginx.conf'
--- files/charm/nginx.conf 2013-09-29 21:58:50 +0000
+++ files/charm/nginx.conf 2013-11-26 12:56:39 +0000
@@ -5,7 +5,7 @@
5 access_log /var/log/nginx/kibana.access.log;5 access_log /var/log/nginx/kibana.access.log;
66
7 location / {7 location / {
8 root /usr/share/kibana3;8 root /srv/kibana3;
9 index index.html index.htm;9 index index.html index.htm;
10 }10 }
1111
1212
=== modified file 'hooks/install'
--- hooks/install 2013-09-29 21:58:50 +0000
+++ hooks/install 2013-11-26 12:56:39 +0000
@@ -1,33 +1,33 @@
1#!/bin/bash1#!/bin/bash
2# Here do anything needed to install the service2set -eux
3# i.e. apt-get install -y foo or bzr branch http://myserver/mycode /srv/webroot
4# Make sure this hook exits cleanly and is idempotent, common problems here are failing to account for a debconf question on a dependency, or trying to pull from github without installing git first.
5set -eux # -x for verbose logging to juju debug-log
6HOME=$PWD3HOME=$PWD
7CHECKSUM="8614d80e8afdb9d936e8574b24e9b405"4KIBANA_SOURCE=$(config-get kibana_source)
8HOST=`unit-get private-address`5KIBANA_SOURCE_UNPACK_DIRECTORY=$(config-get kibana_source_unpack_directory)
6KIBANA_SOURCE_CHECKSUM=$(config-get kibana_source_checksum)
7HOST=$(unit-get private-address)
98
10juju-log "install dependency"9juju-log "install dependency"
11apt-get install -y curl wget git nginx10apt-get install -y curl wget git nginx
1211
13juju-log "download kibana from elasticsearch.org"12juju-log "download kibana from elasticsearch.org"
14wget -q -O /tmp/kibana-latest.tgz https://download.elasticsearch.org/kibana/kibana/kibana-latest.tar.gz13wget -q -O /tmp/kibana.tgz ${KIBANA_SOURCE}
14echo "${KIBANA_SOURCE_CHECKSUM} /tmp/kibana.tgz" > /tmp/kibana.tgz.md5
15md5sum -c /tmp/kibana.tgz.md5
1516
16install -o root -g root -m 0644 files/charm/nginx.conf /etc/nginx/sites-available/kibana17install -o root -g root -m 0644 files/charm/nginx.conf /etc/nginx/sites-available/kibana
17install -o root -g root -m 0644 files/charm/nginx_lb.conf /etc/nginx/sites-available/es_cluster18install -o root -g root -m 0644 files/charm/nginx_lb.conf /etc/nginx/sites-available/es_cluster
1819
19pushd /usr/share20pushd /srv
2021
21tar xzvf /tmp/kibana-latest.tgz22tar xzvf /tmp/kibana.tgz
2223mv ${KIBANA_SOURCE_UNPACK_DIRECTORY} kibana3
23mv kibana-latest kibana3
2424
25rm -f /etc/nginx/sites-enabled/default25rm -f /etc/nginx/sites-enabled/default
2626
27popd27popd
2828
29rm -f /usr/share/kibana3/config.js29rm -f /srv/kibana3/config.js
30install -o root -g root -m 0644 files/charm/config.js /usr/share/kibana3/config.js30install -o root -g root -m 0644 files/charm/config.js /srv/kibana3/config.js
3131
3232
33ln -s /etc/nginx/sites-available/kibana /etc/nginx/sites-enabled/kibana33ln -s /etc/nginx/sites-available/kibana /etc/nginx/sites-enabled/kibana
3434
=== modified file 'hooks/rest-relation-changed'
--- hooks/rest-relation-changed 2013-09-29 21:58:50 +0000
+++ hooks/rest-relation-changed 2013-11-26 12:56:39 +0000
@@ -1,8 +1,5 @@
1#!/bin/bash1#!/bin/bash
2# This must be renamed to the name of the relation. The goal here is to2set -eux
3# affect any change needed by relationships being formed, modified, or broken
4# This script should be idempotent.
5set -eux # -x for verbose logging to juju debug-log
6[ -z "$(relation-get cluster-name)" ] && exit 03[ -z "$(relation-get cluster-name)" ] && exit 0
74
8juju-log $JUJU_REMOTE_UNIT modified its settings5juju-log $JUJU_REMOTE_UNIT modified its settings
96
=== modified file 'hooks/rest-relation-departed'
--- hooks/rest-relation-departed 2012-11-06 04:38:09 +0000
+++ hooks/rest-relation-departed 2013-11-26 12:56:39 +0000
@@ -1,5 +1,2 @@
1#!/bin/sh1#!/bin/sh
2# This must be renamed to the name of the relation. The goal here is to
3# affect any change needed by the remote unit leaving the relationship.
4# This script should be idempotent.
5juju-log $JUJU_REMOTE_UNIT departed2juju-log $JUJU_REMOTE_UNIT departed
63
=== modified file 'hooks/rest-relation-joined'
--- hooks/rest-relation-joined 2013-09-29 21:58:50 +0000
+++ hooks/rest-relation-joined 2013-11-26 12:56:39 +0000
@@ -1,6 +1,2 @@
1#!/bin/bash1#!/bin/bash
2# This must be renamed to the name of the relation. The goal here is to
3# affect any change needed by relationships being formed
4# This script should be idempotent.
5set -eux # -x for verbose logging to juju debug-log
6juju-log $JUJU_REMOTE_UNIT joined
7\ No newline at end of file2\ No newline at end of file
3juju-log $JUJU_REMOTE_UNIT joined
84
=== modified file 'hooks/web-relation-joined'
--- hooks/web-relation-joined 2012-11-22 16:43:50 +0000
+++ hooks/web-relation-joined 2013-11-26 12:56:39 +0000
@@ -1,10 +1,7 @@
1#!/bin/bash1#!/bin/bash
2# This must be renamed to the name of the relation. The goal here is to2set -eux
3# affect any change needed by relationships being formed
4# This script should be idempotent.
5set -eux # -x for verbose logging to juju debug-log
6juju-log $JUJU_REMOTE_UNIT joined3juju-log $JUJU_REMOTE_UNIT joined
74
8# Set ip/port for web relation5# Set ip/port for web relation
9relation-set port="80"6relation-set port="80"
10relation-set host=`unit-get private-address`
11\ No newline at end of file7\ No newline at end of file
8relation-set host=`unit-get private-address`

Subscribers

People subscribed via source and target branches

to all changes: