diff --git a/scripts/ci_production_healthcheck.sh b/scripts/ci_production_healthcheck.sh index 3b311904c..b38c40c2e 100644 --- a/scripts/ci_production_healthcheck.sh +++ b/scripts/ci_production_healthcheck.sh @@ -310,7 +310,7 @@ docker run -d \ --restart unless-stopped \ --cpus 2 \ --memory 2g \ - --health-cmd "sh -c \"for pid in /proc/[0-9]*/cmdline; do if grep -ql celery \"$pid\" 2>/dev/null; then exit 0; fi; done; exit 1\"" \ + --health-cmd "grep -lq celery /proc/[0-9]*/cmdline 2>/dev/null || exit 1" \ --health-interval 30s \ --health-timeout 10s \ --health-retries 3 \ diff --git a/scripts/ci_staging_deploy.sh b/scripts/ci_staging_deploy.sh index 60950c81f..856bc6b54 100755 --- a/scripts/ci_staging_deploy.sh +++ b/scripts/ci_staging_deploy.sh @@ -192,7 +192,7 @@ rollback() { -e PUBLIC_API_BASE_URL=https://staging-api.xiaoxiajianji.com \ -v "$GENERATED_DIR:/app/generated" \ --restart unless-stopped \ - --health-cmd "sh -c \"for pid in /proc/[0-9]*/cmdline; do if grep -ql celery \"\$pid\" 2>/dev/null; then exit 0; fi; done; exit 1\"" \ + --health-cmd "grep -lq celery /proc/[0-9]*/cmdline 2>/dev/null || exit 1" \ --health-interval 30s \ --health-timeout 10s \ --health-retries 3 \ @@ -504,7 +504,7 @@ docker run -d \ -e PUBLIC_API_BASE_URL=https://staging-api.xiaoxiajianji.com \ -v "$GENERATED_DIR:/app/generated" \ --restart unless-stopped \ - --health-cmd "sh -c \"for pid in /proc/[0-9]*/cmdline; do if grep -ql celery \"\$pid\" 2>/dev/null; then exit 0; fi; done; exit 1\"" \ + --health-cmd "grep -lq celery /proc/[0-9]*/cmdline 2>/dev/null || exit 1" \ --health-interval 30s \ --health-timeout 10s \ --health-retries 3 \ diff --git a/scripts/ci_staging_healthcheck.sh b/scripts/ci_staging_healthcheck.sh index 79a63b00e..25808ec1e 100644 --- a/scripts/ci_staging_healthcheck.sh +++ b/scripts/ci_staging_healthcheck.sh @@ -305,7 +305,7 @@ docker run -d \ -e PUBLIC_API_BASE_URL=https://staging-api.xiaoxiajianji.com \ -v "$GENERATED_DIR:/app/generated" \ --restart unless-stopped \ - --health-cmd "sh -c \"for pid in /proc/[0-9]*/cmdline; do if grep -ql celery \"$pid\" 2>/dev/null; then exit 0; fi; done; exit 1\"" \ + --health-cmd "grep -lq celery /proc/[0-9]*/cmdline 2>/dev/null || exit 1" \ --health-interval 30s \ --health-timeout 10s \ --health-retries 3 \ diff --git a/scripts/rollback_production.sh b/scripts/rollback_production.sh index 4e4d3f59c..0e4806318 100755 --- a/scripts/rollback_production.sh +++ b/scripts/rollback_production.sh @@ -201,7 +201,7 @@ docker run -d \ --restart unless-stopped \ --cpus 2 \ --memory 2g \ - --health-cmd "sh -c \"for pid in /proc/[0-9]*/cmdline; do if grep -ql celery \"$pid\" 2>/dev/null; then exit 0; fi; done; exit 1\"" \ + --health-cmd "grep -lq celery /proc/[0-9]*/cmdline 2>/dev/null || exit 1" \ --health-interval 30s \ --health-timeout 10s \ --health-retries 3 \