Merge pull request #638 from weaveworks/circle

More CircleCI Improvements
This commit is contained in:
Paul Bellamy committed 2015-05-08 10:19:18 +01:00
commit 5e5b3ba65e
13 files changed
+47 -31

No files matched your search

+17 -12
View File
@@ -17,13 +17,13 @@ dependencies:
cache_directories:
- "~/docker"
override:
- if [[ -e "$WEAVE_BUILD" ]]; then
docker load -i $WEAVE_BUILD;
else
docker pull weaveworks/weave-build;
mkdir -p $(dirname "$WEAVE_BUILD");
docker save weaveworks/weave-build >$WEAVE_BUILD;
fi
- if [[ -e "$WEAVE_BUILD" ]]; then
docker load -i $WEAVE_BUILD;
else
docker pull weaveworks/weave-build;
mkdir -p $(dirname "$WEAVE_BUILD");
docker save weaveworks/weave-build >$WEAVE_BUILD;
fi
post:
- curl https://sdk.cloud.google.com | bash
- bin/setup-circleci-secrets "$SECRET_PASSWORD"
@@ -32,9 +32,14 @@ dependencies:
test:
override:
- docker run -v /var/run/docker.sock:/run/docker.sock -v /home/ubuntu:/home/go weaveworks/weave-build
- cd $SRCDIR/test; ./gce.sh setup
- cd $SRCDIR/test; . ./gce.sh hosts; ./setup.sh
- cd $SRCDIR/test; . ./gce.sh hosts; ./run_all.sh
- docker run -v /var/run/docker.sock:/run/docker.sock -v /home/ubuntu:/home/go weaveworks/weave-build:
parallel: true
- cd $SRCDIR/test; ./gce.sh setup:
parallel: true
- cd $SRCDIR/test; . ./gce.sh hosts; ./setup.sh:
parallel: true
- cd $SRCDIR/test; . ./gce.sh hosts; ./run_all.sh:
parallel: true
post:
- cd $SRCDIR/test; ./gce.sh destroy
- cd $SRCDIR/test; ./gce.sh destroy:
parallel: true
+2 -2
View File
@@ -10,8 +10,8 @@ start_suite "Ping over cross-host weave network"
weave_on $HOST1 launch
weave_on $HOST2 launch $HOST1
weave_on $HOST2 run $C2/24 -t --name=c2 ubuntu
weave_on $HOST1 run $C1/24 -t --name=c1 ubuntu
weave_on $HOST2 run $C2/24 -t --name=c2 gliderlabs/alpine /bin/sh
weave_on $HOST1 run $C1/24 -t --name=c1 gliderlabs/alpine /bin/sh
assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2"
end_suite
+2 -2
View File
@@ -10,8 +10,8 @@ start_suite "Ping over encrypted cross-host weave network"
weave_on $HOST1 launch -password notverysecure
weave_on $HOST2 launch -password notverysecure $HOST1
weave_on $HOST2 run $C2/24 -t --name=c2 ubuntu
weave_on $HOST1 run $C1/24 -t --name=c1 ubuntu
weave_on $HOST2 run $C2/24 -t --name=c2 gliderlabs/alpine /bin/sh
weave_on $HOST1 run $C1/24 -t --name=c1 gliderlabs/alpine /bin/sh
assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2"
end_suite
+1 -1
View File
@@ -34,7 +34,7 @@ start_suite "exposing weave network to host"
weave_on $HOST1 launch
for c in $C1 $C2 $C3 $C4; do
weave_on $HOST1 run ${c#*:}/24 -t --name=${c%:*} ubuntu
weave_on $HOST1 run ${c#*:}/24 -t --name=${c%:*} gliderlabs/alpine /bin/sh
done
# absence of host connectivity by default
+1 -1
View File
@@ -10,7 +10,7 @@ start_suite "Resolve names on a single host"
weave_on $HOST1 launch-dns 10.2.254.1/24
weave_on $HOST1 run $C2/24 -t --name=c2 -h $NAME ubuntu
weave_on $HOST1 run $C2/24 -t --name=c2 -h $NAME gliderlabs/alpine /bin/sh
weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
assert_dns_record $HOST1 c1 $NAME $C2
+1 -1
View File
@@ -14,7 +14,7 @@ weave_on $HOST2 launch $HOST1
weave_on $HOST1 launch-dns 10.2.254.1/24 -debug
weave_on $HOST2 launch-dns 10.2.254.2/24 -debug
weave_on $HOST2 run $C2/24 -t --name=c2 -h $NAME ubuntu
weave_on $HOST2 run $C2/24 -t --name=c2 -h $NAME gliderlabs/alpine /bin/sh
weave_on $HOST1 run --with-dns $C1/24 --name=c1 -t aanand/docker-dnsutils /bin/sh
assert_dns_record $HOST1 c1 $NAME $C2
+1 -1
View File
@@ -11,7 +11,7 @@ start_suite "Resolve names in custom domain"
weave_on $HOST1 launch-dns 10.2.254.1/24 --domain $DOMAIN.
weave_on $HOST1 run $C2/24 -t --name=c2 -h $NAME ubuntu
weave_on $HOST1 run $C2/24 -t --name=c2 -h $NAME gliderlabs/alpine /bin/sh
weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
assert_dns_record $HOST1 c1 $NAME $C2
+1 -1
View File
@@ -12,7 +12,7 @@ start_suite "Resolve unqualified names"
weave_on $HOST1 launch-dns 10.2.254.1/24
weave_on $HOST1 run $C1/24 -t --name=c1 -h $NAME ubuntu
weave_on $HOST1 run $C1/24 -t --name=c1 -h $NAME gliderlabs/alpine /bin/sh
weave_on $HOST1 run --with-dns $C2/24 -t --name=c2 -h seetwo.$DOMAIN aanand/docker-dnsutils /bin/sh
weave_on $HOST1 run --with-dns $C3/24 -t --name=c3 --dns-search=weave.local aanand/docker-dnsutils /bin/sh
+1 -1
View File
@@ -11,7 +11,7 @@ start_suite "Add and remove names on a single host"
weave_on $HOST1 launch-dns 10.2.254.1/24
weave_on $HOST1 run $C2/24 -t --name=c2 ubuntu
weave_on $HOST1 run $C2/24 -t --name=c2 gliderlabs/alpine /bin/sh
weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
weave_on $HOST1 dns-add $C2 c2 -h $NAME2
+1 -1
View File
@@ -9,7 +9,7 @@ run_on $HOST1 sudo ./weave --local reset
run_on $HOST1 sudo ./weave --local launch
assert_raises "docker_on $HOST1 ps | grep weave"
run_on $HOST1 sudo ./weave --local run 10.2.6.5/24 -ti --name=c1 ubuntu
run_on $HOST1 sudo ./weave --local run 10.2.6.5/24 -ti --name=c1 gliderlabs/alpine /bin/sh
assert_raises "exec_on $HOST1 c1 ifconfig | grep ethwe"
end_suite
+1 -1
View File
@@ -58,7 +58,7 @@ assert_bridge_cidrs() {
}
# Run container with three cidrs
CID=$(DOCKER_HOST=tcp://$HOST1:2375 $WEAVE run 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24 -t --name multicidr -h multicidr.weave.local ubuntu | cut -b 1-12)
CID=$(DOCKER_HOST=tcp://$HOST1:2375 $WEAVE run 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24 -t --name multicidr -h multicidr.weave.local gliderlabs/alpine /bin/sh | cut -b 1-12)
assert_container_cidrs $HOST1 $CID 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.2.1.1 10.2.2.1 10.2.3.1
+5 -6
View File
@@ -14,8 +14,8 @@ TEMPLATE_NAME="test-template"
ZONE=us-central1-a
NUM_HOSTS=2
SUFFIX=""
if [ -n "$CIRCLECI" -a -n "$CIRCLE_SHA1" ]; then
SUFFIX="-${CIRCLE_SHA1:0:7}"
if [ -n "$CIRCLECI" ]; then
SUFFIX="-${CIRCLE_BUILD_NUM}-$CIRCLE_NODE_INDEX"
fi
# Setup authentication
@@ -45,10 +45,9 @@ function internal_ip {
}
function try_connect {
for i in $(seq 0 10); do
if ssh -t $1 true; then
return
fi
for i in {0..10}; do
ssh -t $1 true && return
sleep 2
done
}
+13 -1
View File
@@ -24,7 +24,19 @@ check_test_status() {
# Overwrite assert.sh _assert_cleanup trap with our own
trap check_test_status EXIT
for t in *_test.sh; do
# If running on circle, only run the tests for my "shard".
# CIRCLE_NODE_TOTAL is the total number of shards, and
# CIRCLE_NODE_INDEX is my index.
i=0
TESTS=
for test in *_test.sh; do
if [ -z "$CIRCLECI" ] || [ $(($i % $CIRCLE_NODE_TOTAL)) -eq $CIRCLE_NODE_INDEX ]; then
TESTS="$TESTS $test"
fi
i=$(($i + 1))
done
for t in $TESTS; do
echo
greyly echo "---= Running $t =---"
. $t