ci: use random host port to avoid conflict with existing services
CI Pipeline / HTML Lint (push) Successful in 7s
Deploy QA / Build and Push (push) Successful in 14s
CI Pipeline / Build Docker Image (push) Failing after 1m35s
CI Pipeline / Security Scan (push) Has been skipped
Deploy QA / Deploy to QA (push) Failing after 2s
CI Pipeline / Generate Summary (push) Failing after 1s
Deploy QA / Notification (push) Failing after 1s
CI Pipeline / HTML Lint (push) Successful in 7s
Deploy QA / Build and Push (push) Successful in 14s
CI Pipeline / Build Docker Image (push) Failing after 1m35s
CI Pipeline / Security Scan (push) Has been skipped
Deploy QA / Deploy to QA (push) Failing after 2s
CI Pipeline / Generate Summary (push) Failing after 1s
Deploy QA / Notification (push) Failing after 1s
This commit is contained in:
@@ -70,7 +70,7 @@ jobs:
|
||||
docker stop ci-test || true
|
||||
docker rm ci-test || true
|
||||
docker run -d --name ci-test \
|
||||
--network host \
|
||||
-p 0:80 \
|
||||
-e APP_ENV=ci \
|
||||
-e APP_VERSION=ci-${{ gitea.sha }} \
|
||||
-e BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||
@@ -78,8 +78,9 @@ jobs:
|
||||
-e GIT_BRANCH=${{ gitea.ref_name }} \
|
||||
-e DEPLOY_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||
ci-image:latest
|
||||
CI_PORT=$(docker port ci-test 80 | cut -d: -f2)
|
||||
for i in $(seq 1 12); do
|
||||
if curl -sf http://localhost:80/health > /dev/null 2>&1; then
|
||||
if curl -sf http://localhost:$CI_PORT/health > /dev/null 2>&1; then
|
||||
echo "::notice::Health check passed"
|
||||
docker logs ci-test 2>&1 || true
|
||||
docker stop ci-test
|
||||
|
||||
Reference in New Issue
Block a user