Merge lp:~johnsca/charms/precise/couchbase/fix-install into lp:charms/couchbase

Proposed by Cory Johns on 2015-01-08
Status: Merged
Merged at revision: 13
Proposed branch: lp:~johnsca/charms/precise/couchbase/fix-install
Merge into: lp:charms/couchbase
Diff against target: 41 lines (+17/-3)
1 file modified
hooks/install (+17/-3)
To merge this branch: bzr merge lp:~johnsca/charms/precise/couchbase/fix-install
Reviewer Review Type Date Requested Status
José Antonio Rey 2015-01-08 Approve on 2015-01-09
Review Queue (community) automated testing Needs Fixing on 2015-01-08
Review via email: mp+245892@code.launchpad.net
To post a comment you must log in.
Cory Johns (johnsca) wrote :

Fixes the intermittent error reported in this bug: https://bugs.launchpad.net/charms/+source/couchbase/+bug/1074344

Also fixes the hard-coded open-port paths that also affected couchdb: https://code.launchpad.net/~johnsca/charms/precise/couchbase/fix-install/+merge/243575

Review Queue (review-queue) wrote :

This items has failed automated testing! Results available here http://reports.vapour.ws/charm-tests/charm-bundle-test-10888-results

review: Needs Fixing (automated testing)
José Antonio Rey (jose) wrote :

Hey Cory!

I have given this a run an deploys successfully. Thanks for the fix!

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/install'
2--- hooks/install 2013-02-08 18:55:26 +0000
3+++ hooks/install 2015-01-08 18:16:00 +0000
4@@ -5,7 +5,7 @@
5 set -ux
6
7 apt-get -y install python-software-properties
8-apt-add-repository ppa:facter-plugins/ppa
9+apt-add-repository -y ppa:facter-plugins/ppa
10 apt-get -y update
11 apt-get -y install facter facter-customfacts-plugin curl uuid pwgen libssl0.9.8
12
13@@ -71,6 +71,20 @@
14
15 service couchbase-server status && service couchbase-server restart || service couchbase-server start
16
17+echo "Waiting for couchbase-server..."
18+seconds=0
19+check_server_cmd="/opt/couchbase/bin/couchbase-cli server-info -c ${COUCHBASE_IP}:${COUCHBASE_PORT} \
20+ -u ${DEFAULT_CLUSTER_USERNAME} -p ${DEFAULT_CLUSTER_PASSWORD}"
21+until $check_server_cmd > /dev/null; do
22+ sleep 1
23+ seconds=$((seconds+1))
24+ if [ $seconds -gt 30 ]; then
25+ echo "Time out waiting for couchbase-server"
26+ $check_server_cmd
27+ exit 1
28+ fi
29+done
30+
31 /opt/couchbase/bin/couchbase-cli cluster-init \
32 -c ${COUCHBASE_IP}:${COUCHBASE_PORT} \
33 --cluster-init-username=${DEFAULT_CLUSTER_USERNAME} \
34@@ -87,5 +101,5 @@
35 --bucket-replica=${COUCHBASE_BUCKET_REPLICA}
36
37 # Open the necessary ports
38-[ -x /usr/bin/open-port ] && open-port ${COUCHBASE_PORT}/TCP
39-[ -x /usr/bin/open-port ] && open-port ${COUCHBASE_CLUSTER_PORT}/TCP
40+open-port ${COUCHBASE_PORT}/TCP
41+open-port ${COUCHBASE_CLUSTER_PORT}/TCP

Subscribers

People subscribed via source and target branches

to all changes: