diff --git a/precise/docker-builder/src/usr/local/bin/hook-docker-update b/precise/docker-builder/src/usr/local/bin/hook-docker-update index f4b7316a..4811fc4b 100755 --- a/precise/docker-builder/src/usr/local/bin/hook-docker-update +++ b/precise/docker-builder/src/usr/local/bin/hook-docker-update @@ -12,7 +12,7 @@ KEEP_ONLY_PO="fr en de" include common include pretty - +ansi_color no usage="$exname COMPONENT MASTER_IMAGE_NAME BRANCH UPDATED_IMAGE_NAME" COMPONENT_NAME="$1" @@ -43,12 +43,20 @@ if [ -e "$lock" ]; then fi touch "$lock" +## This path is on the docker HOST ! +AUFS_APPLY_PATH=${AUFS_APPLY_PATH:-/opt/apps/aufs_apply/bin/aufs_apply} + +md5() { + find "$@" -type f -exec md5sum {} \; 2>/dev/null | md5sum | cut -f 1 -d " " +} + clean_all() { cd / mountpoint "$tmpdir_root" 2>/dev/null && umount "$tmpdir_root" [ -d "$tmpdir_root" ] && rmdir "$tmpdir_root" [ -d "$tmpdir_changes" ] && rm -rf "$tmpdir_changes" + rm "$lock" } tmpdir="$DOCKER_UPDATE_PATH"/tmp @@ -58,15 +66,16 @@ tmpdir_root=$(mktemp -d $tmpdir/$COMPONENT_NAME.root.XXXXXX) trap "clean_all" EXIT mount -t aufs -o br=$tmpdir_changes:$DOCKER_UPDATE_PATH/$COMPONENT_NAME -o udba=none none "$tmpdir_root" cd "$tmpdir_root" -set -eux ## XXXvlab: We probably would need to: ## - fetch only the module concerned ## - fetch only the ref concerned +Wrap -d "Update source code" <