Fix build.sh usage function (#1368)

## Description

Usage function not defined before use params are not properly specified

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 CI/Deployment
- [x] 🐹 Trivial/Minor

## Issue(s)

## Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
Georgi Matev 2022-10-30 20:43:16 -07:00 committed by GitHub
parent e4eaf44dcd
commit cd8323fe06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,15 @@
set -e set -e
usage() {
echo "Usage: $(basename $0) binary | image [--platforms ...] [--tag ...]"
echo ""
echo "OPTIONS"
echo " -p | --platforms Platforms to build for (default: $PLATFORMS)"
echo " Specify multiple platforms using ',' (eg: linux/amd64,darwin/arm)"
echo " -t | --tag Tag for container image (default: $TAG)"
}
ROOT=$(dirname $(dirname $(readlink -f $0))) ROOT=$(dirname $(dirname $(readlink -f $0)))
GOVER=1.18 # go version GOVER=1.18 # go version
CORSO_BUILD_CACHE="/tmp/.corsobuild" # shared persistent cache CORSO_BUILD_CACHE="/tmp/.corsobuild" # shared persistent cache
@ -44,15 +53,6 @@ while [ "$#" -gt 0 ]; do
shift shift
done done
usage() {
echo "Usage: $(basename $0) binary | image [--platforms ...] [--tag ...]"
echo ""
echo "OPTIONS"
echo " -p | --platforms Platforms to build for (default: $PLATFORMS)"
echo " Specify multiple platforms using ',' (eg: linux/amd64,darwin/arm)"
echo " -t | --tag Tag for container image (default: $TAG)"
}
if [ "$MODE" == "binary" ]; then if [ "$MODE" == "binary" ]; then
mkdir -p ${CORSO_BUILD_CACHE} # prep env mkdir -p ${CORSO_BUILD_CACHE} # prep env
for platform in ${PLATFORMS/,/ }; do for platform in ${PLATFORMS/,/ }; do