Skip to content

Commit

Permalink
fix arg len checking
Browse files Browse the repository at this point in the history
better var name
  • Loading branch information
ywwg committed Oct 19, 2023
1 parent 187e293 commit 36f8d70
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions scripts/build-and-push-whisper-converter-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ set -eufo pipefail
command -v go >/dev/null 2>&1 || { echo 'Please install go'; exit 1; }
command -v docker >/dev/null 2>&1 || { echo 'Please install docker'; exit 1; }

if [ "$1"x == "x" ] ; then
echo "Need a docker destination path, like myreg/images/"
if [ $# -eq 0 ] ; then
echo "Need a docker registry location, like myreg/images"
echo "'mimir-whisper-converter' will be appended to this path as the image name"
exit 1
fi
DOCKER_NAME="$1"
DOCKER_REGISTRY="$1"

# Build the executable
export CGO_ENABLED=0
Expand All @@ -22,15 +22,13 @@ go build \
"github.com/grafana/mimir-proxies/cmd/mimir-whisper-converter"

# Build the docker image

docker build \
--platform linux/amd64 \
-f cmd/mimir-whisper-converter/Dockerfile \
-t $DOCKER_NAME/mimir-whisper-converter:latest \
-t $DOCKER_REGISTRY/mimir-whisper-converter:latest \
.

# Push the docker image

docker image push $DOCKER_NAME/mimir-whisper-converter:latest
docker image push $DOCKER_REGISTRY/mimir-whisper-converter:latest

echo 'Done'

0 comments on commit 36f8d70

Please sign in to comment.