File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,6 @@ BUILDCTL_OPTS="$@"
1212DEFAULT_REGISTRY=builds-registry.ystack.svc.cluster.local
1313[ -z " $BUILDS_REGISTRY " ] && BUILDS_REGISTRY=$DEFAULT_REGISTRY
1414[ -z " $PUSH_REGISTRY " ] && PUSH_REGISTRY=$DEFAULT_REGISTRY
15- [ -z " $BUILDKIT_CACHE " ] && BUILDKIT_CACHE=" type=registry,ref=$BUILDS_REGISTRY /ystack:buildcache"
16- [ -z " $IMPORT_CACHE " ] && IMPORT_CACHE=" --import-cache=$BUILDKIT_CACHE "
17- [ -z " $EXPORT_CACHE " ] && EXPORT_CACHE=" --export-cache=$BUILDKIT_CACHE "
18- [ " $IMPORT_CACHE " = " false" ] && IMPORT_CACHE=" "
19- [ " $EXPORT_CACHE " = " false" ] && EXPORT_CACHE=" "
2015[ -z " $BUILDKIT_HOST " ] && BUILDKIT_HOST=tcp://buildkitd.ystack.svc.cluster.local:8547
2116
2217if [ " $( curl -s --connect-timeout 3 http://$BUILDS_REGISTRY /v2/) " != " {}" ]
@@ -65,6 +60,13 @@ if [[ ! -z "$GIT_COMMIT" ]]; then
6560 fi
6661fi
6762
63+ REGISTRY_CACHE_DEFAULT=$( echo $IMAGE | sed " s|[^/]*|$BUILDS_REGISTRY /ystack-buildcache|" | sed " s/:$BUILD_TAG //" )
64+ [ -z " $BUILDKIT_CACHE " ] && BUILDKIT_CACHE=" type=registry,ref=$REGISTRY_CACHE_DEFAULT "
65+ [ -z " $IMPORT_CACHE " ] && IMPORT_CACHE=" --import-cache=$BUILDKIT_CACHE "
66+ [ -z " $EXPORT_CACHE " ] && EXPORT_CACHE=" --export-cache=$BUILDKIT_CACHE ,mode=max"
67+ [ " $IMPORT_CACHE " = " false" ] && IMPORT_CACHE=" "
68+ [ " $EXPORT_CACHE " = " false" ] && EXPORT_CACHE=" "
69+
6870echo " Build command:"
6971set -x
7072y-buildctl \
You can’t perform that action at this time.
0 commit comments