[ARVADOS] updated: 5e062b44d6b9ebb70a7b0708436eb463b5e8ae7b

git at public.curoverse.com git at public.curoverse.com
Tue Jul 22 21:18:56 EDT 2014


Summary of changes:
 docker/build.sh             | 12 +++++++++++-
 docker/build_tools/Makefile | 43 +++++++++++++++++++++++++++++++------------
 docker/build_tools/build.rb |  6 +++---
 3 files changed, 45 insertions(+), 16 deletions(-)

       via  5e062b44d6b9ebb70a7b0708436eb463b5e8ae7b (commit)
      from  ba4d612f8448337f555d369ec383d9b4cc055e79 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 5e062b44d6b9ebb70a7b0708436eb463b5e8ae7b
Author: Ward Vandewege <ward at curoverse.com>
Date:   Tue Jul 22 21:18:15 2014 -0400

    Suppress warnings and spurious error messages for the clean, realclean
    and deepclean targets.
    
    refs #3219

diff --git a/docker/build.sh b/docker/build.sh
index cbcc840..e990ccd 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -11,4 +11,14 @@ then
     sudo apt-get -y install ruby1.9.3
 fi
 
-build_tools/build.rb $*
+build_tools/build.rb
+
+if [[ "$?" == "0" ]]; then
+    DOCKER=`which docker.io`
+
+    if [[ "$DOCKER" == "" ]]; then
+      DOCKER=`which docker`
+    fi
+
+    DOCKER=$DOCKER /usr/bin/make -f build_tools/Makefile $*
+fi
diff --git a/docker/build_tools/Makefile b/docker/build_tools/Makefile
index ff95935..74a04df 100644
--- a/docker/build_tools/Makefile
+++ b/docker/build_tools/Makefile
@@ -1,31 +1,50 @@
+# This is the 'shell hack'. Call make with DUMP=1 to see the effect.
+ifdef DUMP
+OLD_SHELL := $(SHELL)
+SHELL = $(warning [$@])$(OLD_SHELL) -x
+endif
+
 all: skydns-image skydock-image api-image compute-image doc-image workbench-image keep-image sso-image shell-image
 
+IMAGE_FILES := $(shell ls *-image 2>/dev/null |grep -v debian-arvados-image)
+GENERATED_FILES := $(shell ls */generated/* 2>/dev/null)
+GENERATED_DIRS := $(shell ls */generated 2>/dev/null)
+
 # `make clean' removes the files generated in the build directory
 # but does not remove any docker images generated in previous builds
 clean:
-	-rm -rf build
-	-rm `ls *-image |grep -v debian-arvados-image` */generated/*
-	- at rmdir */generated
+	@echo "make clean"
+	- at rm -rf build
+	+@[ "$(IMAGE_FILES)$(GENERATED_FILES)" = "" ] || rm $(IMAGE_FILES) $(GENERATED_FILES) 2>/dev/null
+	+@[ "$(GENERATED_DIRS)" = "" ] || rmdir */generated 2>/dev/null
 
 DEBIAN_IMAGE := $(shell $(DOCKER) images -q arvados/debian |head -n1)
 
+REALCLEAN_CONTAINERS := $(shell $(DOCKER) ps -a |grep -e arvados -e api_server -e keep_server -e doc_server -e workbench_server |cut -f 1 -d' ')
+REALCLEAN_IMAGES := $(shell $(DOCKER) images -q arvados/* |grep -v $(DEBIAN_IMAGE) 2>/dev/null)
+DEEPCLEAN_IMAGES := $(shell $(DOCKER) images -q arvados/*)
+SKYDNS_CONTAINERS := $(shell $(DOCKER) ps -a |grep -e crosbymichael/skydns -e crosbymichael/skydock |cut -f 1 -d' ')
+SKYDNS_IMAGES := $(shell $(DOCKER) images -q crosbymichael/skyd*)
+
 # `make realclean' will also remove the Arvados docker images (but not the
 # arvados/debian image) and force subsequent makes to build the entire chain
 # from the ground up
 realclean: clean
-	-[ -n "`$(DOCKER) ps -q`" ] && $(DOCKER) stop `$(DOCKER) ps -q`
-	-$(DOCKER) rm `$(DOCKER) ps -a |grep -e arvados -e api_server -e keep_server -e doc_server -e workbench_server |cut -f 1 -d' '`
-	-$(DOCKER) rmi `$(DOCKER) images -q arvados/* |grep -v $(DEBIAN_IMAGE)`
+	@echo "make realclean"
+	+@[ "`$(DOCKER) ps -q`" = '' ] || $(DOCKER) stop `$(DOCKER) ps -q`
+	+@[ "$(REALCLEAN_CONTAINERS)" = '' ] || $(DOCKER) rm $(REALCLEAN_CONTAINERS)
+	+@[ "$(REALCLEAN_IMAGES)" = '' ] || $(DOCKER) rmi $(REALCLEAN_IMAGES)
 
 # `make deepclean' will remove all Arvados docker images and the skydns/skydock
 # images and force subsequent makes to build the entire chain from the ground up
 deepclean: clean
-	-rm debian-arvados-image
-	-[ -n "`$(DOCKER) ps -q`" ] && $(DOCKER) stop `$(DOCKER) ps -q`
-	-$(DOCKER) rm `$(DOCKER) ps -a |grep -e arvados -e api_server -e keep_server -e doc_server -e workbench_server |cut -f 1 -d' '`
-	-$(DOCKER) rmi `$(DOCKER) images -q arvados/*`
-	-$(DOCKER) rm `$(DOCKER) ps -a |grep -e crosbymichael/skydns -e crosbymichael/skydock |cut -f 1 -d' '`
-	-$(DOCKER) rmi `$(DOCKER) images -q crosbymichael/skyd*`
+	@echo "make deepclean"
+	- at rm -f debian-arvados-image 2>/dev/null
+	+@[ "`$(DOCKER) ps -q`" = '' ] || $(DOCKER) stop `$(DOCKER) ps -q`
+	+@[ "$(REALCLEAN_CONTAINERS)" = '' ] || $(DOCKER) rm $(REALCLEAN_CONTAINERS)
+	+@[ "$(DEEPCLEAN_IMAGES)" = '' ] || $(DOCKER) rmi $(DEEPCLEAN_IMAGES)
+	+@[ "$(SKYDNS_CONTAINERS)" = '' ] || $(DOCKER) rm $(SKYDNS_CONTAINERS)
+	+@[ "$(SKYDNS_IMAGES)" = '' ] || $(DOCKER) rmi $(SKYDNS_IMAGES)
 
 # ============================================================
 # Dependencies for */generated files which are prerequisites
diff --git a/docker/build_tools/build.rb b/docker/build_tools/build.rb
index 4fef356..df76d52 100755
--- a/docker/build_tools/build.rb
+++ b/docker/build_tools/build.rb
@@ -96,8 +96,9 @@ def main options
       docker_ok? docker_path and
       debootstrap_ok? and
       File.exists? 'config.yml'
-    warn "Building Arvados."
-    system({"DOCKER" => docker_path}, '/usr/bin/make', '-f', options[:makefile], *ARGV)
+    exit 0
+  else
+    exit 6
   end
 end
 
@@ -243,6 +244,5 @@ if __FILE__ == $PROGRAM_NAME
       options[:makefile] = mk
     end
   end
-
   main options
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list