From 51797270c7774e3c101917420019d22fd5b839c0 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Tue, 11 May 2021 12:39:35 +0200 Subject: [PATCH 1/2] Do we still have this issue? --- bin/y-build-like-sync | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/y-build-like-sync b/bin/y-build-like-sync index 79f722a7..fb99cf5c 100755 --- a/bin/y-build-like-sync +++ b/bin/y-build-like-sync @@ -35,9 +35,9 @@ RUNTIME_IMAGE=$1 [ -z "$RUNTIME_IMAGE" ] && echo "First argument must be a runtime image to append the layer to" \ && echo "To improve build times use a runtime image in the target repo" && exit 1 -# crane hangs for a long time if it doesn't know that the registry is plain http -RUNTIME_IMAGE=$(echo $RUNTIME_IMAGE | sed 's|.local/|.local:80/|') -IMAGE=$(echo $IMAGE | sed 's|.local/|.local:80/|') +# # crane hangs for a long time if it doesn't know that the registry is plain http +# RUNTIME_IMAGE=$(echo $RUNTIME_IMAGE | sed 's|.local/|.local:80/|') +# IMAGE=$(echo $IMAGE | sed 's|.local/|.local:80/|') # This is a PoC, let's make a lot of assumptions to simplify context=. From 7a10918b9ae2febaae74dc8bb72cf4c43c67d3b8 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Tue, 11 May 2021 14:00:33 +0200 Subject: [PATCH 2/2] Supports locally built & locally docker buildable runtime changes --- bin/y-build-like-sync | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bin/y-build-like-sync b/bin/y-build-like-sync index fb99cf5c..650a5e03 100755 --- a/bin/y-build-like-sync +++ b/bin/y-build-like-sync @@ -35,6 +35,22 @@ RUNTIME_IMAGE=$1 [ -z "$RUNTIME_IMAGE" ] && echo "First argument must be a runtime image to append the layer to" \ && echo "To improve build times use a runtime image in the target repo" && exit 1 +# Experimental support for runtime dev loops +case "$RUNTIME_IMAGE" in + $BUILDS_REGISTRY*-dirty ) + docker inspect $RUNTIME_IMAGE >/dev/null && docker push $RUNTIME_IMAGE || true + ;; + $BUILDS_REGISTRY*:../* ) + RUNTIME_BUILD_CONTEXT=$(echo $RUNTIME_IMAGE | cut -d':' -f 2) + RUNTIME_IMAGE=$(echo $RUNTIME_IMAGE | cut -d':' -f 1):y-build-like-sync-devloop + docker build -t $RUNTIME_IMAGE $RUNTIME_BUILD_CONTEXT + docker push $RUNTIME_IMAGE + ;; + $BUILDS_REGISTRY* ) + y-crane validate --remote=$RUNTIME_IMAGE + ;; +esac + # # crane hangs for a long time if it doesn't know that the registry is plain http # RUNTIME_IMAGE=$(echo $RUNTIME_IMAGE | sed 's|.local/|.local:80/|') # IMAGE=$(echo $IMAGE | sed 's|.local/|.local:80/|')