This is an automated email from the ASF dual-hosted git repository.

hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 7c045b22 Add more sanity checks for docker image (#1877)
7c045b22 is described below

commit 7c045b227485a9ff75a1260b146bdfe4cf5171ba
Author: jyf111 <[email protected]>
AuthorDate: Thu Nov 9 12:54:40 2023 +0800

    Add more sanity checks for docker image (#1877)
---
 .github/workflows/kvrocks.yaml | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/kvrocks.yaml b/.github/workflows/kvrocks.yaml
index 58dcefe4..25e47cf3 100644
--- a/.github/workflows/kvrocks.yaml
+++ b/.github/workflows/kvrocks.yaml
@@ -310,7 +310,19 @@ jobs:
           tags: kvrocks:ci
           outputs: type=docker
       - name: Test built image
-        run: docker run --rm kvrocks:ci -v
+        run: |
+          docker run --rm kvrocks:ci -v
+          ID="$(docker run --rm -d -p 6666:6666 kvrocks:ci)"
+          sleep 1m
+          if [ "$(docker inspect --format='{{.State.Health.Status}}' $ID)" != 
"healthy" ]; then
+            echo "The container is not healthy."
+            exit 1
+          fi
+          if [ "$(ss --listening --no-header --tcp '( sport = :6666 )')" == "" 
]; then
+            echo "The container listening port can not be accessed from 
outside."
+            exit 1
+          fi
+          docker stop $ID
 
   build-and-test-in-container:
     name: Build and test in container

Reply via email to