perf(blog): preserve dependency cache before quality checks
This commit is contained in:
1 parent
83efb25978
commit
be032170db
2 files changed
+23
-4
No files matched your search
@@ -121,6 +121,19 @@ spec:
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
case "$DEPLOY_ENV" in staging|prod) ;; *) echo 'Invalid deployment environment' >&2; exit 1;; esac
|
||||
# Export dependencies before checking the app, so a failed check does
|
||||
# not discard all the work performed by this ephemeral builder.
|
||||
buildctl-daemonless.sh build \
|
||||
--frontend dockerfile.v0 \
|
||||
--local context="$SOURCE_DIR" \
|
||||
--local dockerfile="$SOURCE_DIR" \
|
||||
--opt filename=Dockerfile \
|
||||
--opt target=quality-deps \
|
||||
--opt platform=linux/arm64 \
|
||||
--import-cache "type=registry,ref=$CACHE_REPOSITORY:cache-quality-deps-arm64-$DEPLOY_ENV" \
|
||||
--import-cache "type=registry,ref=$CACHE_REPOSITORY:cache-quality-arm64-$DEPLOY_ENV" \
|
||||
--import-cache "type=registry,ref=$CACHE_REPOSITORY:cache-release-arm64-$DEPLOY_ENV" \
|
||||
--export-cache "type=registry,ref=$CACHE_REPOSITORY:cache-quality-deps-arm64-$DEPLOY_ENV,mode=max,image-manifest=true,oci-mediatypes=true"
|
||||
buildctl-daemonless.sh build \
|
||||
--frontend dockerfile.v0 \
|
||||
--local context="$SOURCE_DIR" \
|
||||
@@ -128,6 +141,7 @@ spec:
|
||||
--opt filename=Dockerfile \
|
||||
--opt target=quality \
|
||||
--opt platform=linux/arm64 \
|
||||
--import-cache "type=registry,ref=$CACHE_REPOSITORY:cache-quality-deps-arm64-$DEPLOY_ENV" \
|
||||
--import-cache "type=registry,ref=$CACHE_REPOSITORY:cache-quality-arm64-$DEPLOY_ENV" \
|
||||
--import-cache "type=registry,ref=$CACHE_REPOSITORY:cache-release-arm64-$DEPLOY_ENV" \
|
||||
--export-cache "type=registry,ref=$CACHE_REPOSITORY:cache-quality-arm64-$DEPLOY_ENV,mode=max,image-manifest=true,oci-mediatypes=true"
|
||||
@@ -264,6 +278,7 @@ spec:
|
||||
--opt target=runtime \
|
||||
--opt platform=linux/arm64 \
|
||||
--import-cache "type=registry,ref=$CACHE_REPOSITORY:cache-release-arm64-$DEPLOY_ENV" \
|
||||
--import-cache "type=registry,ref=$CACHE_REPOSITORY:cache-quality-deps-arm64-$DEPLOY_ENV" \
|
||||
--import-cache "type=registry,ref=$CACHE_REPOSITORY:cache-quality-arm64-$DEPLOY_ENV" \
|
||||
--export-cache "type=registry,ref=$CACHE_REPOSITORY:cache-release-arm64-$DEPLOY_ENV,mode=max,image-manifest=true,oci-mediatypes=true" \
|
||||
--output "type=image,name=$IMAGE,push=true" \
|
||||
|
||||
Reference in new issue
Block a user