From 1586b334e09d7fba2ee3f8cb8ace88553af23203 Mon Sep 17 00:00:00 2001 From: Amir Abushareb Date: Mon, 22 Jun 2015 15:21:54 +0300 Subject: [PATCH] circle: split across containers --- bin/ci.sh | 17 +++++++++++++++++ circle.yml | 17 +++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) create mode 100755 bin/ci.sh diff --git a/bin/ci.sh b/bin/ci.sh new file mode 100755 index 00000000..23e60a22 --- /dev/null +++ b/bin/ci.sh @@ -0,0 +1,17 @@ + +set -e + +i=0 +tests='' +browsers=(chrome firefox safari ie:11 ie:10 ie:9 ie:8) +index=${CIRCLE_NODE_INDEX:-0} +total=${CIRCLE_NODE_TOTAL:-7} + +for name in ${browsers[@]}; do + if [ $(($i % $total)) -eq $index ]; then + tests+=&& (BROWSER=$name make test-sauce) + fi + ((i+=1)) +done + +${tests} \ No newline at end of file diff --git a/circle.yml b/circle.yml index 45a06372..6d77a2d9 100644 --- a/circle.yml +++ b/circle.yml @@ -5,21 +5,10 @@ machine: dependencies: override: + - echo "github.com,192.30.252.*,192.30.253.*,192.30.254.*,192.30.255.* ssh-rsa $(ssh-keyscan -t rsa github.com | cut -d ' ' -f 3-)" >> ~/.ssh/known_hosts - make build test: override: - - BROWSER=chrome make test-sauce: - parallel: true - - BROWSER=firefox make test-sauce: - parallel: true - - BROWSER=safari make test-sauce: - parallel: true - - BROWSER=ie:11 make test-sauce: - parallel: true - - BROWSER=ie:10 make test-sauce: - parallel: true - - BROWSER=ie:9 make test-sauce: - parallel: true - - BROWSER=ie:8 make test-sauce: - parallel: true + - bash bin/ci.sh: + parallel: true \ No newline at end of file