mirror of
https://github.com/iflytek/skillhub.git
synced 2026-08-27 11:14:59 +00:00
fix(ci): wait for final PostgreSQL process
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
This commit is contained in:
parent
4fe1563e5f
commit
7b3f1144f7
1 changed files with 12 additions and 4 deletions
|
|
@ -46,17 +46,25 @@ docker run -d \
|
|||
postgres:16-alpine >/dev/null
|
||||
|
||||
log "waiting for PostgreSQL readiness"
|
||||
postgres_ready="false"
|
||||
for _ in $(seq 1 60); do
|
||||
if docker exec "${POSTGRES_CONTAINER}" \
|
||||
pid_one_comm="$(
|
||||
docker exec "${POSTGRES_CONTAINER}" \
|
||||
cat /proc/1/comm 2>/dev/null || true
|
||||
)"
|
||||
if [[ "${pid_one_comm}" == "postgres" ]] \
|
||||
&& docker exec "${POSTGRES_CONTAINER}" \
|
||||
pg_isready -U "${POSTGRES_USER}" -d "${POSTGRES_DB}" \
|
||||
>/dev/null 2>&1; then
|
||||
postgres_ready="true"
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
docker exec "${POSTGRES_CONTAINER}" \
|
||||
pg_isready -U "${POSTGRES_USER}" -d "${POSTGRES_DB}" \
|
||||
>/dev/null
|
||||
if [[ "${postgres_ready}" != "true" ]]; then
|
||||
log "PostgreSQL did not become ready after entrypoint initialization"
|
||||
exit 1
|
||||
fi
|
||||
log "PostgreSQL is ready"
|
||||
|
||||
run_test() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue