Browse Source

Fix CI: Shut down the cluster afterward

Apparently the new travis image won't stop until all your background
processes are dead, which I suppose is nice of it but took me a long
time to figure out.
Evan Huus 8 years ago
parent
commit
ebd8effe6a
2 changed files with 18 additions and 4 deletions
  1. 3 4
      .travis.yml
  2. 15 0
      vagrant/halt_cluster.sh

+ 3 - 4
.travis.yml

@@ -22,8 +22,7 @@ before_install:
 - vagrant/boot_cluster.sh
 - vagrant/create_topics.sh
 
-install:
-- make install_dependencies
+install: make install_dependencies
 
 script:
 - make test
@@ -32,6 +31,6 @@ script:
 - make fmt
 
 after_success:
-  - bash <(curl -s https://codecov.io/bash)
+- bash <(curl -s https://codecov.io/bash)
 
-sudo: false
+after_script: vagrant/halt_cluster.sh

+ 15 - 0
vagrant/halt_cluster.sh

@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -ex
+
+for i in 1 2 3 4 5; do
+    KAFKA_PORT=`expr $i + 9090`
+    cd ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_PORT} && bin/kafka-server-stop.sh
+done
+
+for i in 1 2 3 4 5; do
+    KAFKA_PORT=`expr $i + 9090`
+    cd ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_PORT} && bin/zookeeper-server-stop.sh
+done
+
+killall toxiproxy