From: Loic Dachary Date: Sat, 20 Dec 2014 22:28:28 +0000 (+0100) Subject: tests: ceph.spec.in or debian/control rebuild docker images X-Git-Tag: v0.92~109^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=19b6de3eeebe8983c20856320e4d8bbfe4a6f786;p=ceph.git tests: ceph.spec.in or debian/control rebuild docker images If any of the files in test/$os_type is newer than the creation date of a docker image, the image is removed and rebuilt from scratch. For instance, when a package is added to debian/control, the debian based images are rebuilt. Signed-off-by: Loic Dachary --- diff --git a/src/test/docker-test-helper.sh b/src/test/docker-test-helper.sh index 3f20d8e405f..2b64baa3e98 100755 --- a/src/test/docker-test-helper.sh +++ b/src/test/docker-test-helper.sh @@ -49,7 +49,18 @@ function setup_container() { local opts="$3" local image=$(get_image_name $os_type $os_version) - if ! docker images $image | grep --quiet "^$image " ; then + local build=true + if docker images $image | grep --quiet "^$image " ; then + eval touch --date=$(docker inspect $image | jq '.[0].Created') $image + found=$(find -L test/$os_type/* -newer $image) + rm $image + if test -n "$found" ; then + docker rmi $image + else + build=false + fi + fi + if $build ; then # # In the dockerfile, # replace environment variables %%FOO%% with their content