Skip to content

Commit caa1248

Browse files
committed
test
1 parent d1bdab4 commit caa1248

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ bundle-build:
278278
&& if [ -d terraform ]; then terraform -chdir=terraform init -backend=false; terraform -chdir=terraform validate; fi \
279279
&& FULL_IMAGE_NAME_PREFIX=${FULL_IMAGE_NAME_PREFIX} IMAGE_NAME_PREFIX=${IMAGE_NAME_PREFIX} \
280280
${MAKEFILE_DIR}/devops/scripts/bundle_runtime_image_build.sh \
281+
&& if [ -n "$${CI_CACHE_ACR_NAME:-}" ]; then \
282+
az acr login -n $${CI_CACHE_ACR_NAME}; \
283+
export CI_CACHE_ACR_FQDN="$${CI_CACHE_ACR_NAME:+$${CI_CACHE_ACR_NAME}${ACR_DOMAIN_SUFFIX}}"; fi \
281284
&& ${MAKEFILE_DIR}/devops/scripts/porter_build_bundle.sh \
282285
$(MAKE) bundle-check-params
283286

devops/scripts/porter_build_bundle.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,12 @@ if [ -f "porter-build-context.env" ]; then
99
porter build --build-context "$PORTER_BUILD_CONTEXT"
1010

1111
else
12-
porter build
12+
if [ -n "${CI_CACHE_ACR_FQDN}" ]; then
13+
ref="${CI_CACHE_ACR_FQDN}/build-cache/$(yq ".name" porter.yaml):porter"
14+
porter build \
15+
--cache-to type=registry,ref="${ref}",mode=max \
16+
--cache-from type=registry,ref="${ref}"
17+
else
18+
porter build
19+
fi
1320
fi

0 commit comments

Comments
 (0)