Remove test.sh save

This doesn't appear to actually do anything and just rebuilds all the
images for some reason.
pull/9021/head
Jason Wilder 2017-10-30 10:56:37 -06:00
parent 4c3e673376
commit 00763b0105
2 changed files with 1 additions and 58 deletions

View File

@ -14,9 +14,7 @@ dependencies:
- "~/docker"
- ~/download
override:
- ./test.sh save:
# building the docker images can take a long time, hence caching
timeout: 1800
- ./test.sh count
test:
override:

55
test.sh
View File

@ -10,7 +10,6 @@
# 2: normal 32bit tests
# 3: tsi build
# 4: go 1.9
# save: build the docker images and save them to DOCKER_SAVE_DIR. Do not run tests.
# count: print the number of test environments
# *: to run all tests in parallel containers
#
@ -24,8 +23,6 @@ cd $DIR
ENVIRONMENT_INDEX=$1
# Set the default OUTPUT_DIR
OUTPUT_DIR=${OUTPUT_DIR-./test-logs}
# Set the default DOCKER_SAVE_DIR
DOCKER_SAVE_DIR=${DOCKER_SAVE_DIR-$HOME/docker}
# Set default parallelism
PARALLELISM=${PARALLELISM-1}
# Set default timeout
@ -97,33 +94,6 @@ function build_docker_image {
}
# Saves a docker image to $DOCKER_SAVE_DIR
function save_docker_image {
local dockerfile=$1
local imagename=$(filename2imagename "$dockerfile")
local imagefile="$DOCKER_SAVE_DIR/${imagename}.tar.gz"
if [ ! -d "$DOCKER_SAVE_DIR" ]
then
mkdir -p "$DOCKER_SAVE_DIR"
fi
if [[ -e "$imagefile" ]]
then
zcat $imagefile | docker load
fi
imageid=$(docker images -q --no-trunc "$imagename")
build_docker_image "$dockerfile" "$imagename"
newimageid=$(docker images -q --no-trunc "$imagename")
rc=0
if [ "$imageid" != "$newimageid" ]
then
docker save "$imagename" | gzip > "$imagefile"
rc="${PIPESTATUS[0]}"
fi
return "$rc"
}
if [ ! -d "$OUTPUT_DIR" ]
then
mkdir -p "$OUTPUT_DIR"
@ -158,31 +128,6 @@ case $ENVIRONMENT_INDEX in
run_test_docker Dockerfile_build_ubuntu64_go19 test_64bit --test --junit-report
rc=$?
;;
"save")
# Save docker images for every Dockerfile_build* file.
# Useful for creating an external cache.
pids=()
for d in Dockerfile_build*
do
echo "Building and saving $d ..."
save_docker_image "$d" > $OUTPUT_DIR/${d}.log 2>&1 &
pids+=($!)
done
echo "Waiting..."
# Wait for all saves to finish
for pid in "${pids[@]}"
do
wait $pid
rc=$(($? + $rc))
done
# Check if all saves passed
if [ $rc -eq 0 ]
then
echo "All saves succeeded"
else
echo "Some saves failed, check logs in $OUTPUT_DIR"
fi
;;
"count")
echo $ENV_COUNT
;;