9a0d1a6ff2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
636 B
Bash
Executable File
36 lines
636 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
REGISTRY="registry.bcos.cloud"
|
|
SHOULD_PUSH=false
|
|
|
|
while [[ "$#" -gt 0 ]]; do
|
|
case $1 in
|
|
--registry) REGISTRY="$2"; shift ;;
|
|
--push) SHOULD_PUSH=true ;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
# Use :dev tag for the dev registry, :latest for everything else
|
|
if [[ "$REGISTRY" == *"bcos.dev"* ]]; then
|
|
TAG="dev"
|
|
else
|
|
TAG="latest"
|
|
fi
|
|
|
|
IMAGE="$REGISTRY/hiveiq-aria:$TAG"
|
|
|
|
echo "Building JAR..."
|
|
mvn clean package -DskipTests -B
|
|
|
|
echo "Building Docker image: $IMAGE"
|
|
docker build -t "$IMAGE" .
|
|
|
|
if [ "$SHOULD_PUSH" = true ]; then
|
|
echo "Pushing $IMAGE..."
|
|
docker push "$IMAGE"
|
|
fi
|
|
|
|
echo "Done: $IMAGE"
|