Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CI): utilize the common build cache for container builds #1756

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
3 changes: 2 additions & 1 deletion scripts/deploy/build-deploy-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ build_image() {
local BUILD_ARGS_CMD=''
local LABEL_PARAMETER=''
local DISABLE_CACHE_PARAMETER=''
local CACHE='quay.io/cloudservices/build-cache'

if is_pr_or_mr_build; then
LABEL_PARAMETER=$(get_expiry_label_parameter)
Expand All @@ -252,7 +253,7 @@ build_image() {
fi

#shellcheck disable=SC2086
container_engine_cmd build --pull -f "$DOCKERFILE" $BUILD_ARGS_CMD $LABEL_PARAMETER \
container_engine_cmd build --cache-from="$CACHE" --cache-to="$CACHE" --pull -f "$DOCKERFILE" $BUILD_ARGS_CMD $LABEL_PARAMETER \
$DISABLE_CACHE_PARAMETER \
-t "${IMAGE_NAME}:${IMAGE_TAG}" .

Expand Down