From 33e86c8669b5cb51cec3b86dc16d690170f6f770 Mon Sep 17 00:00:00 2001 From: Alisa Date: Sun, 12 May 2024 21:01:50 +0800 Subject: [PATCH] fix: docker test in CI failed (#1695) * feat: allow to run ci for test * fix: use latest tag in docker compose to fix CI issue --- .github/workflows/ci.yml | 1 + docker-compose.yml | 2 +- scripts/workflow/test-docker.sh | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 025eb92b..b69905cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: - 'CHANGELOG.MD' branches: master pull_request: + workflow_dispatch: name: CI jobs: diff --git a/docker-compose.yml b/docker-compose.yml index 6350c578..d8bb9890 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: app: container_name: mx-server - image: innei/mx-server:5 + image: innei/mx-server:latest environment: - TZ=Asia/Shanghai - NODE_ENV=production diff --git a/scripts/workflow/test-docker.sh b/scripts/workflow/test-docker.sh index d0a99c13..98f2e303 100644 --- a/scripts/workflow/test-docker.sh +++ b/scripts/workflow/test-docker.sh @@ -18,6 +18,8 @@ if [[ $? -ne 0 ]]; then exit 1 fi +docker images + (docker-compose up &) if [[ $? -ne 0 ]]; then @@ -28,6 +30,7 @@ fi RETRY=0 do_request() { + docker ps -a curl -f -m 10 localhost:2333/api/v2 -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36' }