Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,16 @@ install-tekton-pipelines: ## Install Tekton pipelines in KinD cluster.
.PHONY: install-tekton-pipelines

build-and-push-images: ## Build and push images to local registry.
cd scripts && ./build-and-push-images.sh
cd scripts && ./build-and-push-images.sh --image start
cd scripts && ./build-and-push-images.sh --image finish
cd scripts && ./build-and-push-images.sh --image buildah
cd scripts && ./build-and-push-images.sh --image sonar
cd scripts && ./build-and-push-images.sh --image webhook-interceptor
cd scripts && ./build-and-push-images.sh --image go-toolset
cd scripts && ./build-and-push-images.sh --image gradle-toolset
cd scripts && ./build-and-push-images.sh --image python-toolset
cd scripts && ./build-and-push-images.sh --image helm
cd scripts && ./build-and-push-images.sh --image node16-typescript-toolset --platform linux/amd64
.PHONY: build-and-push-images

install-ods-tasks-kind: ## KinD only! Apply ODS ClusterTask manifests in KinD
Expand Down
14 changes: 13 additions & 1 deletion scripts/build-and-push-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ IMAGES=""
http_proxy="${http_proxy:-}"
https_proxy="${https_proxy:-}"

PLATFORM=""
# eg. --platform linux/amd64

while [[ "$#" -gt 0 ]]; do
case $1 in

Expand All @@ -24,6 +27,9 @@ while [[ "$#" -gt 0 ]]; do
-i|--image) IMAGES="$2"; shift;;
-i=*|--image=*) IMAGES="${1#*=}";;

-p|--platform) PLATFORM="$2"; shift;;
-p=*|--platform=*) PLATFORM="${1#*=}";;

*) echo "Unknown parameter passed: $1"; exit 1;;
esac; shift; done

Expand All @@ -33,7 +39,8 @@ build_and_push_image() {
odsImage="ods-$image"
if [ "${SKIP_BUILD}" != "true" ]; then
echo "Building image $REGISTRY/$NAMESPACE/$odsImage..."
docker build \
# shellcheck disable=SC2086
docker build $platform_arg \
--build-arg http_proxy="$http_proxy" \
--build-arg https_proxy="$https_proxy" \
--build-arg HTTP_PROXY="$http_proxy" \
Expand All @@ -44,6 +51,11 @@ build_and_push_image() {
docker push "$REGISTRY/$NAMESPACE/$odsImage"
}

platform_arg=
if [ -n "$PLATFORM" ]; then
platform_arg="--platform=${PLATFORM}"
fi

if [ -z "$IMAGES" ]; then
for file in build/package/Dockerfile.*; do
image=${file##*Dockerfile.}
Expand Down