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

Create run-make-cmd.sh #2046

Merged
merged 1 commit into from
Apr 3, 2023
Merged
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
33 changes: 33 additions & 0 deletions hack/run-make-cmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
code-elinka marked this conversation as resolved.
Show resolved Hide resolved

code-elinka marked this conversation as resolved.
Show resolved Hide resolved
# Run make commands that build and push images
# (see Dockerfiles in the root directory)

# ENV variables:
# * BINARY (example: "e2e-test")
# * ALL_ARCH (example: "amd64 arm64")
# * REGISTRY (container registry)
# * VERBOSE (example: -3)

set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
REPO_ROOT=$(git rev-parse --show-toplevel)
cd ${REPO_ROOT}

BINARY=${BINARY:-e2e-test}
ARCH=${ARCH:-"amd64"}
ALL_ARCH=${ALL_ARCH:-"amd64 arm64"}
REGISTRY=${REGISTRY:-gcr.io/example}
VERBOSE=${VERBOSE:1}

# This command builds an image of $BINARY and
# pushes it to the $REGISTRY
make push VERBOSE="${VERBOSE}" CONTAINER_BINARIES="${BINARY}" \
REGISTRY="${REGISTRY}" ARCH="${ARCH}"
# Based on the image from the previous step,
# all-push command will try to create a multiarch image
# (there is no $ARCH parameter)
make all-push VERBOSE="${VERBOSE}" CONTAINER_BINARIES="${BINARY}" \
REGISTRY="${REGISTRY}" ALL_ARCH="${ALL_ARCH}"