Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ENHANCEMENTS:
* Update Porter, AzureCLI, Terraform and its providers across the solution ([#4799](https://github.com/microsoft/AzureTRE/issues/4799))
* Update `api_healthcheck.sh` script with fixed 10-second check intervals and 7-minute timeout for improved API health monitoring ([#4807](https://github.com/microsoft/AzureTRE/issues/4807))
* Update SuperLinter to version 8.3.2 ([#4815](https://github.com/microsoft/AzureTRE/issues/4815))
* Add porter build cache in CI ([#4827](https://github.com/microsoft/AzureTRE/issues/4827))

BUG FIXES:
* Replace deprecated `--username` flag with `--client-id` in `az login --identity` commands across all Porter bundles ([#4817](https://github.com/microsoft/AzureTRE/issues/4817))
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ bundle-build:
&& if [ -d terraform ]; then terraform -chdir=terraform init -backend=false; terraform -chdir=terraform validate; fi \
&& FULL_IMAGE_NAME_PREFIX=${FULL_IMAGE_NAME_PREFIX} IMAGE_NAME_PREFIX=${IMAGE_NAME_PREFIX} \
${MAKEFILE_DIR}/devops/scripts/bundle_runtime_image_build.sh \
&& if [ -n "$${CI_CACHE_ACR_NAME:-}" ]; then \
az acr login -n $${CI_CACHE_ACR_NAME}; \
export CI_CACHE_ACR_FQDN="$${CI_CACHE_ACR_NAME:+$${CI_CACHE_ACR_NAME}${ACR_DOMAIN_SUFFIX}}"; fi \
&& ${MAKEFILE_DIR}/devops/scripts/porter_build_bundle.sh \
$(MAKE) bundle-check-params

Expand Down
16 changes: 15 additions & 1 deletion devops/scripts/porter_build_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,19 @@ if [ -f "porter-build-context.env" ]; then
porter build --build-context "$PORTER_BUILD_CONTEXT"

else
porter build
if [ -n "${CI_CACHE_ACR_FQDN}" ]; then

# Ensure docker buildx builder exists with registry cache support
if ! docker buildx inspect tre-builder >/dev/null 2>&1; then
echo "Creating docker buildx builder with registry cache support..."
docker buildx create --name tre-builder --driver docker-container --use
else
docker buildx use tre-builder
fi

ref="${CI_CACHE_ACR_FQDN}/build-cache/$(yq '.name' porter.yaml):porter"
cache=(--cache-to "type=registry,ref=${ref},mode=max" --cache-from "type=registry,ref=${ref}")
fi

porter build "${cache[@]}"
fi
Loading