Skip to content

Commit

Permalink
bug fixes in build bash scripts
Browse files Browse the repository at this point in the history
Signed-off-by: SRIKUMAR VENUGOPAL <srikumarv@ie.ibm.com>
  • Loading branch information
srikumar003 committed Jan 21, 2024
1 parent d0826f2 commit a04271c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 28 deletions.
8 changes: 4 additions & 4 deletions build-tools/build_components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ if [ $BUILD_AND_PUSH = "yes" ]; then
if [ $CREATE_NEW_BUILDX_CONTEXT = "yes" ]; then
docker buildx create --use
fi
(cd ../src/dataset-operator && ./build_and_push_multiarch_dataset_operator.sh $REGISTRY_URL)
(cd ../src/generate-keys && ./build_and_push_multiarch_generate_keys.sh $REGISTRY_URL)
(cd ../src/dataset-operator && ./build_multiarch_dataset_operator.sh -p $REGISTRY_URL)
(cd ../src/generate-keys && ./build_multiarch_generate_keys.sh -p $REGISTRY_URL)
else
(cd ../src/dataset-operator && ./build_and_push_multiarch_dataset_operator.sh $REGISTRY_URL --nopush)
(cd ../src/generate-keys && ./build_and_push_multiarch_generate_keys.sh $REGISTRY_URL --nopush)
(cd ../src/dataset-operator && ./build_multiarch_dataset_operator.sh $REGISTRY_URL)
(cd ../src/generate-keys && ./build_multiarch_generate_keys.sh $ REGISTRY_URL)
fi
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
#!/bin/bash

print_usage() {
echo "usage: $0 [-p] <REGISTRY_URL> <VERSION>"
echo "Use -p to build and push multiarch images"
}

PUSH="false"
while getopts 'p' flag; do
case "$flag" in
p)
PUSH="true"
;;
?)
print_usage >&2
exit 1
;;
esac
done

shift $((OPTIND-1))

REGISTRY_URL="${1:-quay.io/datashim-io}"
VERSION="${2:-latest}"

echo $REGISTRY_URL
echo $VERSION

docker_build () {
docker buildx build --platform linux/amd64,linux/arm64,linux/ppc64le -t ${REGISTRY_URL}/dataset-operator:${VERSION} .
}
Expand Down Expand Up @@ -40,18 +66,6 @@ else
fi
fi

REGISTRY_URL="${1:-quay.io/datashim-io}"
VERSION="${2:-latest}"

PUSH="true"
for arg in "$@"; do
if [ $arg == "--nopush" ]
then
echo "the images should not be pushed to the registry"
PUSH="false"
fi
done

if [ $PUSH == "true" ]
then
echo "pushing images to the registry"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
#!/bin/bash
set -e

print_usage() {
echo "usage: $0 [-p] <REGISTRY_URL> <VERSION>"
echo "Use -p to build and push multiarch images"
}

PUSH="false"
while getopts 'p' flag; do
case "$flag" in
p)
PUSH="true"
;;
?)
print_usage >&2
exit 1
;;
esac
done

shift $((OPTIND-1))

REGISTRY_URL="${1:-quay.io/datashim-io}"
VERSION="${2:-latest}"

echo $REGISTRY_URL
echo $VERSION

docker_build () {
docker buildx build --platform linux/amd64,linux/arm64 -t ${REGISTRY_URL}/generate-keys:${VERSION} .
Expand Down Expand Up @@ -40,18 +67,6 @@ else
fi
fi

REGISTRY_URL="${1:-quay.io/datashim-io}"
VERSION="${2:-latest}"

PUSH="true"
for arg in "$@"; do
if [ $arg == "--nopush" ]
then
echo "the images should not be pushed to the registry"
PUSH="false"
fi
done

if [ $PUSH == "true" ]
then
echo "pushing images to the registry"
Expand Down

0 comments on commit a04271c

Please sign in to comment.