Skip to content

Commit 888acb4

Browse files
committed
Merge branch 'y-build-like-sync-devloop' into kubernetes-assert-example-specs
2 parents 10abad9 + 7a10918 commit 888acb4

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

bin/y-build-like-sync

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,25 @@ RUNTIME_IMAGE=$1
3535
[ -z "$RUNTIME_IMAGE" ] && echo "First argument must be a runtime image to append the layer to" \
3636
&& echo "To improve build times use a runtime image in the target repo" && exit 1
3737

38-
# crane hangs for a long time if it doesn't know that the registry is plain http
39-
RUNTIME_IMAGE=$(echo $RUNTIME_IMAGE | sed 's|.local/|.local:80/|')
40-
IMAGE=$(echo $IMAGE | sed 's|.local/|.local:80/|')
38+
# Experimental support for runtime dev loops
39+
case "$RUNTIME_IMAGE" in
40+
$BUILDS_REGISTRY*-dirty )
41+
docker inspect $RUNTIME_IMAGE >/dev/null && docker push $RUNTIME_IMAGE || true
42+
;;
43+
$BUILDS_REGISTRY*:../* )
44+
RUNTIME_BUILD_CONTEXT=$(echo $RUNTIME_IMAGE | cut -d':' -f 2)
45+
RUNTIME_IMAGE=$(echo $RUNTIME_IMAGE | cut -d':' -f 1):y-build-like-sync-devloop
46+
docker build -t $RUNTIME_IMAGE $RUNTIME_BUILD_CONTEXT
47+
docker push $RUNTIME_IMAGE
48+
;;
49+
$BUILDS_REGISTRY* )
50+
y-crane validate --remote=$RUNTIME_IMAGE
51+
;;
52+
esac
53+
54+
# # crane hangs for a long time if it doesn't know that the registry is plain http
55+
# RUNTIME_IMAGE=$(echo $RUNTIME_IMAGE | sed 's|.local/|.local:80/|')
56+
# IMAGE=$(echo $IMAGE | sed 's|.local/|.local:80/|')
4157

4258
# This is a PoC, let's make a lot of assumptions to simplify
4359
context=.

0 commit comments

Comments
 (0)