arokoolamayowa commented on code in PR #14167:
URL: https://github.com/apache/iceberg/pull/14167#discussion_r2386487890


##########
docker/iceberg-rest-fixture/test.sh:
##########
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+set -euo pipefail  # Exit on error, treat unset variables as error, fail on 
pipeline errors
+
+# Define variables
+IMAGE_NAME="iceberg-rest-fixture:test"
+DOCKERFILE_PATH="docker/iceberg-rest-fixture/Dockerfile"
+CONTAINER_NAME="iceberg-rest-test"
+PORT=8181
+
+# Step 1: Build the required JAR using Gradle
+echo "Building the open-api module JAR..."
+./gradlew :open-api:build
+
+# Step 2: Build the Docker image
+echo "Building Docker image from $DOCKERFILE_PATH..."
+docker build -t $IMAGE_NAME -f $DOCKERFILE_PATH .
+
+# Step 3: Run the container in detached mode
+echo "Starting container..."
+docker run -d --name $CONTAINER_NAME -p $PORT:$PORT $IMAGE_NAME
+
+# Step 4: Wait for the container to start (healthcheck interval is 1s, retries 
10, so wait up to 15s)
+echo "Waiting for healthcheck..."
+sleep 15
+
+# Step 5: Check if the container is running
+if [ "$(docker inspect -f '{{.State.Running}}' $CONTAINER_NAME)" != "true" ]; 
then
+  echo "Error: Container failed to start."
+  docker logs $CONTAINER_NAME
+  exit 1
+fi
+
+# Step 6: Perform healthcheck manually (matches the Dockerfile's HEALTHCHECK)

Review Comment:
   i have updated the code to do that 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to