Skip to content

Commit

Permalink
Run smoketests with images tagged ':smoketest' rather than ':latest'
Browse files Browse the repository at this point in the history
- moved `docker save` from Makefile to setup.sh
  • Loading branch information
bboreham committed Jan 14, 2016
1 parent d97c385 commit 69b9904
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 1 addition & 4 deletions Makefile
Expand Up @@ -57,7 +57,7 @@ BUILD_FLAGS=-i -ldflags "-extldflags \"-static\" -X main.version=$(WEAVE_VERSION

PACKAGE_BASE=$(shell go list -e ./)

all: $(WEAVE_EXPORT) $(RUNNER_EXE) $(TEST_TLS_EXE)
all: $(IMAGES_UPTODATE) $(RUNNER_EXE) $(TEST_TLS_EXE)
exes: $(EXES)


Expand Down Expand Up @@ -146,9 +146,6 @@ $(DOCKERPLUGIN_UPTODATE): prog/plugin/Dockerfile $(DOCKERPLUGIN_EXE)
$(SUDO) docker build -t $(DOCKERPLUGIN_IMAGE) prog/plugin
touch $@

$(WEAVE_EXPORT): $(IMAGES_UPTODATE)
$(SUDO) DOCKER_HOST=$(DOCKER_HOST) docker save $(addsuffix :latest,$(IMAGES)) | gzip > $@

$(DOCKER_DISTRIB):
curl -o $(DOCKER_DISTRIB) $(DOCKER_DISTRIB_URL)

Expand Down
2 changes: 2 additions & 0 deletions test/config.sh
Expand Up @@ -11,6 +11,8 @@ if ! [ -z "$SOURCED_CONFIG_SH" ]; then
fi
SOURCED_CONFIG_SH=true

export WEAVE_VERSION=${WEAVE_VERSION:-smoketest}

# these ought to match what is in Vagrantfile
N_MACHINES=${N_MACHINES:-3}
IP_PREFIX=${IP_PREFIX:-192.168.48}
Expand Down
12 changes: 11 additions & 1 deletion test/setup.sh
Expand Up @@ -13,7 +13,7 @@ echo " prefetch test images"

setup_host() {
HOST=$1
docker_on $HOST load -i ../weave.tar.gz
docker_on $HOST load -i /tmp/weave.tar.gz
DANGLING_IMAGES="$(docker_on $HOST images -q -f dangling=true)"
[ -n "$DANGLING_IMAGES" ] && docker_on $HOST rmi $DANGLING_IMAGES 1>/dev/null 2>&1 || true
run_on $HOST mkdir -p bin
Expand All @@ -25,6 +25,16 @@ setup_host() {
done
}

tag_images()
{
for image in $@; do
docker tag -f $image:latest $image:$WEAVE_VERSION
done
}

tag_images weaveworks/weave weaveworks/weaveexec weaveworks/plugin
docker save weaveworks/weave:$WEAVE_VERSION weaveworks/weaveexec:$WEAVE_VERSION weaveworks/plugin:$WEAVE_VERSION | gzip > /tmp/weave.tar.gz

for HOST in $HOSTS; do
setup_host $HOST &
done
Expand Down

0 comments on commit 69b9904

Please sign in to comment.