diff --git a/k8/deployment.yaml b/k8/deployment.yaml index 2dc098244f..4d30fda577 100644 --- a/k8/deployment.yaml +++ b/k8/deployment.yaml @@ -39,7 +39,7 @@ spec: spec: containers: - name: polaris - image: localhost:5001/polaris:latest + image: localhost:5001/apache/polaris:latest ports: - containerPort: 8181 - containerPort: 8182 diff --git a/run.sh b/run.sh index 5947b89858..088cfd7bac 100755 --- a/run.sh +++ b/run.sh @@ -21,56 +21,46 @@ # Runs Polaris as a mini-deployment locally. Creates two pods that bind themselves to port 8181. -# Initialize variables -BUILD_ARGS="" # Initialize an empty string to store Docker build arguments - # Function to display usage information usage() { - echo "Usage: $0 [-b build-arg1=value1;build-arg2=value2;...] [-h]" - echo " -b Pass a set of arbitrary build arguments to docker build, separated by semicolons" - echo " -h Display this help message" + echo "Usage: $0 [--eclipse-link-deps=] [-h|--help]" + echo " --eclipse-link-deps= EclipseLink dependencies to use, e.g." + echo " --eclipse-link-deps=org.postgresql:postgresql:42.7.4" + echo " -h, --help Display this help message" exit 1 } # Parse command-line arguments -while getopts "b:h" opt; do - case ${opt} in - b) - IFS=';' read -ra ARGS <<< "${OPTARG}" # Split the semicolon-separated list into an array - for arg in "${ARGS[@]}"; do - BUILD_ARGS+=" --build-arg ${arg}" # Append each build argument to the list - done +while [[ "$#" -gt 0 ]]; do + case $1 in + --eclipse-link-deps=*) + ECLIPSE_LINK_DEPS="-PeclipseLinkDeps=${1#*=}" ;; - h) + -h|--help) usage ;; *) usage ;; esac + shift done -# Shift off the options and arguments -shift $((OPTIND-1)) - # Deploy the registry echo "Building Kind Registry..." sh ./kind-registry.sh -# Check if BUILD_ARGS is not empty and print the build arguments -if [[ -n "$BUILD_ARGS" ]]; then - echo "Building polaris image with build arguments:$BUILD_ARGS" -else - echo "Building polaris image without any additional build arguments." -fi - # Build and deploy the server image echo "Building polaris image..." -docker build -t localhost:5001/polaris $BUILD_ARGS -f Dockerfile . +./gradlew :polaris-quarkus-server:build $ECLIPSE_LINK_DEPS \ + -Dquarkus.container-image.build=true \ + -Dquarkus.container-image.registry=localhost:5001 + echo "Pushing polaris image..." -docker push localhost:5001/polaris +docker push localhost:5001/apache/polaris + echo "Loading polaris image to kind..." -kind load docker-image localhost:5001/polaris:latest +kind load docker-image localhost:5001/apache/polaris:latest echo "Applying kubernetes manifests..." kubectl delete -f k8/deployment.yaml --ignore-not-found