summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBogdan Dobrelya <bdobrelia@mirantis.com>2016-02-15 12:28:34 +0100
committerBogdan Dobrelya <bdobrelia@mirantis.com>2016-03-15 16:03:54 +0100
commite35736537d4397750244de798a19c6674cf5841c (patch)
treead4dccb0b7d6450c46136adbe56f03179405849f /scripts
parent9a02ab05715068740cb125123a271a8f705a6bde (diff)
downloadrabbitmq-server-git-e35736537d4397750244de798a19c6674cf5841c.tar.gz
Add Travis CI job to deploy and smoke test a rabbit OCF
* Add a CI job which triggers only if there are changes to the scripts/rabbitmq-server-ha.ocf * Add a script to setup a cluster by the pacemaker OCF RA and issue a simple smoke test for the cluster membership. Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/travis_test_ocf_ra.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/travis_test_ocf_ra.sh b/scripts/travis_test_ocf_ra.sh
new file mode 100644
index 0000000000..e8f9a74194
--- /dev/null
+++ b/scripts/travis_test_ocf_ra.sh
@@ -0,0 +1,30 @@
+#!/bin/sh -eux
+# Prepare and run a smoke test against the RabbitMQ OCF RA only if
+# the scripts/rabbitmq-server-ha.ocf has changes
+if ! git diff HEAD~ --name-only | grep -q scripts/rabbitmq-server-ha.ocf
+then
+ exit 0
+fi
+
+export VAGRANT_VERSION=1.8.1
+export DOCKER_IMAGE=bogdando/rabbitmq-cluster-ocf-wily
+export UPLOAD_METHOD=none
+export DOCKER_MOUNTS="$(pwd)/scripts/rabbitmq-server-ha.ocf:/tmp/rabbitmq-server-ha"
+
+# Install vagrant and requirements
+sudo apt-get install -qq git wget
+wget --no-verbose https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb
+sudo dpkg -i --force-all ./vagrant_${VAGRANT_VERSION}_x86_64.deb
+vagrant plugin install vagrant-triggers
+
+# Update docker and prepare images
+sudo apt-get update
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --only-upgrade docker-engine
+sudo service docker restart
+docker pull $DOCKER_IMAGE
+
+# Prepare and run a smoke test for a rabbitmq cluster by the OCF RA
+git clone https://github.com/bogdando/rabbitmq-cluster-ocf-vagrant.git
+cd ./rabbitmq-cluster-ocf-vagrant
+vagrant up --provider docker
+docker exec -it n1 /bin/bash /vagrant/vagrant_script/test_rabbitcluster.sh rabbit@n1 rabbit@n2