Skip to content

Commit

Permalink
Add an architecture suffix to images pushed for multi-platform
Browse files Browse the repository at this point in the history
In order to reduce the likelihood of users accidentally forgetting to
specify unique tags for each architecture, we can add a suffix to the
pushed image if an arch-specific one doesn't exist.

Signed-off-by: arewm <[email protected]>
  • Loading branch information
arewm committed Jul 23, 2024
1 parent 6dd763a commit 9c611cd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions task-generator/remote/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ mkdir -p scripts
echo "$BUILD_DIR"
ssh $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/volumes"
if [ "${IMAGE##*-}" != "${PLATFORM##*-}" ]; then
export IMAGE="${IMAGE}-${PLATFORM##*-}"
fi
PORT_FORWARD=""
PODMAN_PORT_FORWARD=""
if [ -n "$JVM_BUILD_WORKSPACE_ARTIFACT_CACHE_PORT_80_TCP_ADDR" ] ; then
Expand Down
4 changes: 4 additions & 0 deletions task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ spec:
echo "$BUILD_DIR"
ssh $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/volumes"
if [ "${IMAGE##*-}" != "${PLATFORM##*-}" ]; then
export IMAGE="${IMAGE}-${PLATFORM##*-}"
fi
PORT_FORWARD=""
PODMAN_PORT_FORWARD=""
if [ -n "$JVM_BUILD_WORKSPACE_ARTIFACT_CACHE_PORT_80_TCP_ADDR" ] ; then
Expand Down
4 changes: 4 additions & 0 deletions task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ spec:
echo "$BUILD_DIR"
ssh $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/volumes"
if [ "${IMAGE##*-}" != "${PLATFORM##*-}" ]; then
export IMAGE="${IMAGE}-${PLATFORM##*-}"
fi
PORT_FORWARD=""
PODMAN_PORT_FORWARD=""
if [ -n "$JVM_BUILD_WORKSPACE_ARTIFACT_CACHE_PORT_80_TCP_ADDR" ] ; then
Expand Down
4 changes: 4 additions & 0 deletions task/buildah-remote/0.1/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ spec:
echo "$BUILD_DIR"
ssh $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/volumes"
if [ "${IMAGE##*-}" != "${PLATFORM##*-}" ]; then
export IMAGE="${IMAGE}-${PLATFORM##*-}"
fi
PORT_FORWARD=""
PODMAN_PORT_FORWARD=""
if [ -n "$JVM_BUILD_WORKSPACE_ARTIFACT_CACHE_PORT_80_TCP_ADDR" ] ; then
Expand Down
4 changes: 4 additions & 0 deletions task/buildah-remote/0.2/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ spec:
echo "$BUILD_DIR"
ssh $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/volumes"
if [ "${IMAGE##*-}" != "${PLATFORM##*-}" ]; then
export IMAGE="${IMAGE}-${PLATFORM##*-}"
fi
PORT_FORWARD=""
PODMAN_PORT_FORWARD=""
if [ -n "$JVM_BUILD_WORKSPACE_ARTIFACT_CACHE_PORT_80_TCP_ADDR" ] ; then
Expand Down

0 comments on commit 9c611cd

Please sign in to comment.