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

Proposed by Cory Johns
Status: Needs review
Proposed branch: lp:~johnsca/charms/precise/couchbase/fix-install
Merge into: lp:~mbruzek/charms/precise/couchbase/tests
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
Matt Bruzek Pending
Review via email: mp+243575@code.launchpad.net

Description of the change

Added wait for server to fix intermittent failure. Fixed hard-coded paths to open-port.

To post a comment you must log in.

Unmerged revisions

13. By Cory Johns

Fixed install hook

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/install'
--- hooks/install 2013-02-08 18:55:26 +0000
+++ hooks/install 2014-12-03 18:35:43 +0000
@@ -5,7 +5,7 @@
5set -ux5set -ux
66
7apt-get -y install python-software-properties7apt-get -y install python-software-properties
8apt-add-repository ppa:facter-plugins/ppa8apt-add-repository -y ppa:facter-plugins/ppa
9apt-get -y update9apt-get -y update
10apt-get -y install facter facter-customfacts-plugin curl uuid pwgen libssl0.9.810apt-get -y install facter facter-customfacts-plugin curl uuid pwgen libssl0.9.8
1111
@@ -71,6 +71,20 @@
7171
72service couchbase-server status && service couchbase-server restart || service couchbase-server start72service couchbase-server status && service couchbase-server restart || service couchbase-server start
7373
74echo "Waiting for couchbase-server..."
75seconds=0
76check_server_cmd="/opt/couchbase/bin/couchbase-cli server-info -c ${COUCHBASE_IP}:${COUCHBASE_PORT} \
77 -u ${DEFAULT_CLUSTER_USERNAME} -p ${DEFAULT_CLUSTER_PASSWORD}"
78until $check_server_cmd > /dev/null; do
79 sleep 1
80 seconds=$((seconds+1))
81 if [ $seconds -gt 30 ]; then
82 echo "Time out waiting for couchbase-server"
83 $check_server_cmd
84 exit 1
85 fi
86done
87
74/opt/couchbase/bin/couchbase-cli cluster-init \88/opt/couchbase/bin/couchbase-cli cluster-init \
75 -c ${COUCHBASE_IP}:${COUCHBASE_PORT} \89 -c ${COUCHBASE_IP}:${COUCHBASE_PORT} \
76 --cluster-init-username=${DEFAULT_CLUSTER_USERNAME} \90 --cluster-init-username=${DEFAULT_CLUSTER_USERNAME} \
@@ -87,5 +101,5 @@
87 --bucket-replica=${COUCHBASE_BUCKET_REPLICA}101 --bucket-replica=${COUCHBASE_BUCKET_REPLICA}
88102
89# Open the necessary ports103# Open the necessary ports
90[ -x /usr/bin/open-port ] && open-port ${COUCHBASE_PORT}/TCP104open-port ${COUCHBASE_PORT}/TCP
91[ -x /usr/bin/open-port ] && open-port ${COUCHBASE_CLUSTER_PORT}/TCP105open-port ${COUCHBASE_CLUSTER_PORT}/TCP

Subscribers

People subscribed via source and target branches

to all changes: