diff options
| author | Bogdan Dobrelya <bdobrelia@mirantis.com> | 2016-02-15 12:28:34 +0100 |
|---|---|---|
| committer | Bogdan Dobrelya <bdobrelia@mirantis.com> | 2016-03-15 16:03:54 +0100 |
| commit | e35736537d4397750244de798a19c6674cf5841c (patch) | |
| tree | ad4dccb0b7d6450c46136adbe56f03179405849f | |
| parent | 9a02ab05715068740cb125123a271a8f705a6bde (diff) | |
| download | rabbitmq-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>
| -rw-r--r-- | .travis.yml | 12 | ||||
| -rw-r--r-- | scripts/travis_test_ocf_ra.sh | 30 |
2 files changed, 40 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml index 6d9dbc0b71..da19ebc302 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ sudo: false +services: + - docker language: erlang notifications: email: @@ -11,14 +13,20 @@ otp_release: - "R16B03-1" - "17.5" - "18.0" +env: + matrix: + - GROUP=1 GROUP=2 # The checkout made by Travis is a "detached HEAD". We switch back # to a tag or a branch. This pleases our git_rmq fetch method in # rabbitmq-components.mk and the proper tag/branch is selected in # dependencies too. -before_script: (test "$TRAVIS_TAG" && git checkout "$TRAVIS_TAG") || (test "$TRAVIS_BRANCH" && git checkout "$TRAVIS_BRANCH") +before_script: + - ([ "${GROUP}" = "1" ] && ((test "$TRAVIS_TAG" && git checkout "$TRAVIS_TAG") || (test "$TRAVIS_BRANCH" && git checkout "$TRAVIS_BRANCH")) || /bin/true) -script: travis_wait make tests +script: + - ([ "${GROUP}" = "1" ] && travis_wait make tests) + - ([ "${GROUP}" = "2" ] && sh ./scripts/travis_test_ocf_ra.sh) cache: apt: true 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 |
