Skip to content

Commit

Permalink
Back to buildx
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
  • Loading branch information
pierDipi committed Feb 18, 2025
1 parent f50df93 commit 64197ed
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,19 @@ export TRANSFORM_JSONATA_DIR="${REPO_ROOT_DIR}/transform-jsonata"

function build_transform_jsonata_image() {

download_pack_cli || return $?

cd "${TRANSFORM_JSONATA_DIR}" && \
pack build "${TRANSFORM_JSONATA_IMAGE_WITH_TAG}-arm64" \
--builder docker.io/heroku/builder:24 \
--platform "linux/arm64" \
--clear-cache && \
cd -

cd "${TRANSFORM_JSONATA_DIR}" && \
pack build "${TRANSFORM_JSONATA_IMAGE_WITH_TAG}-amd64" \
--builder docker.io/heroku/builder:24 \
--platform "linux/amd64" \
--clear-cache && \
cd -
docker builx build \
-t "${TRANSFORM_JSONATA_IMAGE_WITH_TAG}-arm64" \
-f "${REPO_ROOT_DIR}/transform-jsonata/Dockerfile" \
--platform "linux/arm64" \
"${REPO_ROOT_DIR}/transform-jsonata" \
|| return $?

docker builx build \
-t "${TRANSFORM_JSONATA_IMAGE_WITH_TAG}-amd64" \
-f "${REPO_ROOT_DIR}/transform-jsonata/Dockerfile" \
--platform "linux/amd64" \
"${REPO_ROOT_DIR}/transform-jsonata" \
|| return $?
}

function push_transform_jsonata_image() {
Expand All @@ -53,11 +51,3 @@ function push_transform_jsonata_image() {
function build_integration_images() {
"${REPO_ROOT_DIR}/mvnw" clean package -P knative -DskipTests || return $?
}

function download_pack_cli() {
local dir
dir="$(mktemp -d)"
git clone --depth 1 --branch "v0.36.4" https://github.com/buildpacks/pack.git "${dir}"
cd "${dir}" && go install ./cmd/pack && cd - || return $?
rm -rf "${dir}"
}

0 comments on commit 64197ed

Please sign in to comment.