Merge pull request #638 from weaveworks/circle
More CircleCI Improvements
This commit is contained in:
commit
5e5b3ba65e
13 files changed
+47
-31
No files matched your search
+17
-12
@@ -17,13 +17,13 @@ dependencies:
|
|||||||
cache_directories:
|
cache_directories:
|
||||||
- "~/docker"
|
- "~/docker"
|
||||||
override:
|
override:
|
||||||
- if [[ -e "$WEAVE_BUILD" ]]; then
|
- if [[ -e "$WEAVE_BUILD" ]]; then
|
||||||
docker load -i $WEAVE_BUILD;
|
docker load -i $WEAVE_BUILD;
|
||||||
else
|
else
|
||||||
docker pull weaveworks/weave-build;
|
docker pull weaveworks/weave-build;
|
||||||
mkdir -p $(dirname "$WEAVE_BUILD");
|
mkdir -p $(dirname "$WEAVE_BUILD");
|
||||||
docker save weaveworks/weave-build >$WEAVE_BUILD;
|
docker save weaveworks/weave-build >$WEAVE_BUILD;
|
||||||
fi
|
fi
|
||||||
post:
|
post:
|
||||||
- curl https://sdk.cloud.google.com | bash
|
- curl https://sdk.cloud.google.com | bash
|
||||||
- bin/setup-circleci-secrets "$SECRET_PASSWORD"
|
- bin/setup-circleci-secrets "$SECRET_PASSWORD"
|
||||||
@@ -32,9 +32,14 @@ dependencies:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
override:
|
override:
|
||||||
- docker run -v /var/run/docker.sock:/run/docker.sock -v /home/ubuntu:/home/go weaveworks/weave-build
|
- docker run -v /var/run/docker.sock:/run/docker.sock -v /home/ubuntu:/home/go weaveworks/weave-build:
|
||||||
- cd $SRCDIR/test; ./gce.sh setup
|
parallel: true
|
||||||
- cd $SRCDIR/test; . ./gce.sh hosts; ./setup.sh
|
- cd $SRCDIR/test; ./gce.sh setup:
|
||||||
- cd $SRCDIR/test; . ./gce.sh hosts; ./run_all.sh
|
parallel: true
|
||||||
|
- cd $SRCDIR/test; . ./gce.sh hosts; ./setup.sh:
|
||||||
|
parallel: true
|
||||||
|
- cd $SRCDIR/test; . ./gce.sh hosts; ./run_all.sh:
|
||||||
|
parallel: true
|
||||||
post:
|
post:
|
||||||
- cd $SRCDIR/test; ./gce.sh destroy
|
- cd $SRCDIR/test; ./gce.sh destroy:
|
||||||
|
parallel: true
|
||||||
@@ -10,8 +10,8 @@ start_suite "Ping over cross-host weave network"
|
|||||||
weave_on $HOST1 launch
|
weave_on $HOST1 launch
|
||||||
weave_on $HOST2 launch $HOST1
|
weave_on $HOST2 launch $HOST1
|
||||||
|
|
||||||
weave_on $HOST2 run $C2/24 -t --name=c2 ubuntu
|
weave_on $HOST2 run $C2/24 -t --name=c2 gliderlabs/alpine /bin/sh
|
||||||
weave_on $HOST1 run $C1/24 -t --name=c1 ubuntu
|
weave_on $HOST1 run $C1/24 -t --name=c1 gliderlabs/alpine /bin/sh
|
||||||
assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2"
|
assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2"
|
||||||
|
|
||||||
end_suite
|
end_suite
|
||||||
@@ -10,8 +10,8 @@ start_suite "Ping over encrypted cross-host weave network"
|
|||||||
weave_on $HOST1 launch -password notverysecure
|
weave_on $HOST1 launch -password notverysecure
|
||||||
weave_on $HOST2 launch -password notverysecure $HOST1
|
weave_on $HOST2 launch -password notverysecure $HOST1
|
||||||
|
|
||||||
weave_on $HOST2 run $C2/24 -t --name=c2 ubuntu
|
weave_on $HOST2 run $C2/24 -t --name=c2 gliderlabs/alpine /bin/sh
|
||||||
weave_on $HOST1 run $C1/24 -t --name=c1 ubuntu
|
weave_on $HOST1 run $C1/24 -t --name=c1 gliderlabs/alpine /bin/sh
|
||||||
assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2"
|
assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2"
|
||||||
|
|
||||||
end_suite
|
end_suite
|
||||||
@@ -34,7 +34,7 @@ start_suite "exposing weave network to host"
|
|||||||
weave_on $HOST1 launch
|
weave_on $HOST1 launch
|
||||||
|
|
||||||
for c in $C1 $C2 $C3 $C4; do
|
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
|
done
|
||||||
|
|
||||||
# absence of host connectivity by default
|
# absence of host connectivity by default
|
||||||
|
|||||||
@@ -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 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
|
weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
|
||||||
|
|
||||||
assert_dns_record $HOST1 c1 $NAME $C2
|
assert_dns_record $HOST1 c1 $NAME $C2
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ weave_on $HOST2 launch $HOST1
|
|||||||
weave_on $HOST1 launch-dns 10.2.254.1/24 -debug
|
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 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
|
weave_on $HOST1 run --with-dns $C1/24 --name=c1 -t aanand/docker-dnsutils /bin/sh
|
||||||
|
|
||||||
assert_dns_record $HOST1 c1 $NAME $C2
|
assert_dns_record $HOST1 c1 $NAME $C2
|
||||||
|
|||||||
@@ -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 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
|
weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
|
||||||
|
|
||||||
assert_dns_record $HOST1 c1 $NAME $C2
|
assert_dns_record $HOST1 c1 $NAME $C2
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ start_suite "Resolve unqualified names"
|
|||||||
|
|
||||||
weave_on $HOST1 launch-dns 10.2.254.1/24
|
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 $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
|
weave_on $HOST1 run --with-dns $C3/24 -t --name=c3 --dns-search=weave.local aanand/docker-dnsutils /bin/sh
|
||||||
|
|
||||||
|
|||||||
@@ -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 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 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
|
||||||
|
|
||||||
weave_on $HOST1 dns-add $C2 c2 -h $NAME2
|
weave_on $HOST1 dns-add $C2 c2 -h $NAME2
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ run_on $HOST1 sudo ./weave --local reset
|
|||||||
run_on $HOST1 sudo ./weave --local launch
|
run_on $HOST1 sudo ./weave --local launch
|
||||||
assert_raises "docker_on $HOST1 ps | grep weave"
|
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"
|
assert_raises "exec_on $HOST1 c1 ifconfig | grep ethwe"
|
||||||
|
|
||||||
end_suite
|
end_suite
|
||||||
@@ -58,7 +58,7 @@ assert_bridge_cidrs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Run container with three 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_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
|
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.2.1.1 10.2.2.1 10.2.3.1
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -14,8 +14,8 @@ TEMPLATE_NAME="test-template"
|
|||||||
ZONE=us-central1-a
|
ZONE=us-central1-a
|
||||||
NUM_HOSTS=2
|
NUM_HOSTS=2
|
||||||
SUFFIX=""
|
SUFFIX=""
|
||||||
if [ -n "$CIRCLECI" -a -n "$CIRCLE_SHA1" ]; then
|
if [ -n "$CIRCLECI" ]; then
|
||||||
SUFFIX="-${CIRCLE_SHA1:0:7}"
|
SUFFIX="-${CIRCLE_BUILD_NUM}-$CIRCLE_NODE_INDEX"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup authentication
|
# Setup authentication
|
||||||
@@ -45,10 +45,9 @@ function internal_ip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function try_connect {
|
function try_connect {
|
||||||
for i in $(seq 0 10); do
|
for i in {0..10}; do
|
||||||
if ssh -t $1 true; then
|
ssh -t $1 true && return
|
||||||
return
|
sleep 2
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-1
@@ -24,7 +24,19 @@ check_test_status() {
|
|||||||
# Overwrite assert.sh _assert_cleanup trap with our own
|
# Overwrite assert.sh _assert_cleanup trap with our own
|
||||||
trap check_test_status EXIT
|
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
|
echo
|
||||||
greyly echo "---= Running $t =---"
|
greyly echo "---= Running $t =---"
|
||||||
. $t
|
. $t
|
||||||
|
|||||||
Reference in new issue
Block a user