kopia lustrzana https://github.com/FacilMap/facilmap
Add healthcheck to docker image and wait for it before running integration tests
rodzic
dc3973f0c0
commit
1a12e6abea
|
@ -32,6 +32,10 @@ jobs:
|
|||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
-
|
||||
name: Start integration test components in background
|
||||
run: docker compose -f ./integration-tests/docker-compose.yml up -d --quiet-pull mysql postgres &
|
||||
|
||||
-
|
||||
name: Build docker image
|
||||
uses: docker/build-push-action@v5
|
||||
|
@ -44,9 +48,12 @@ jobs:
|
|||
|
||||
-
|
||||
name: Start integration test components
|
||||
uses: isbang/compose-action@v1.5.1
|
||||
with:
|
||||
compose-file: ./integration-tests/docker-compose.yml
|
||||
run: |
|
||||
if ! docker compose -f ./integration-tests/docker-compose.yml up --wait; then
|
||||
status="$?"
|
||||
docker compose -f ./integration-tests/docker-compose.yml logs
|
||||
exit "$status"
|
||||
fi
|
||||
|
||||
-
|
||||
name: Run integration tests
|
||||
|
|
|
@ -4,6 +4,8 @@ MAINTAINER Candid Dauth <cdauth@cdauth.eu>
|
|||
CMD yarn run prod-server
|
||||
EXPOSE 8080
|
||||
ENV CACHE_DIR=/opt/facilmap/cache
|
||||
HEALTHCHECK --start-period=60s --start-interval=3s --timeout=5s --retries=1 \
|
||||
CMD wget -O/dev/null 'http://127.0.0.1:8080/socket.io/?EIO=4&transport=polling' || exit 1
|
||||
|
||||
RUN apk add --no-cache yarn
|
||||
|
||||
|
|
|
@ -3,6 +3,9 @@ services:
|
|||
image: facilmap-ci
|
||||
links:
|
||||
- mysql
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
|
@ -19,6 +22,8 @@ services:
|
|||
MYSQL_USER: facilmap
|
||||
MYSQL_PASSWORD: facilmap
|
||||
MYSQL_RANDOM_ROOT_PASSWORD: "true"
|
||||
healthcheck:
|
||||
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
|
||||
|
||||
|
||||
facilmap-postgres:
|
||||
|
@ -40,3 +45,5 @@ services:
|
|||
POSTGRES_USER: facilmap
|
||||
POSTGRES_PASSWORD: facilmap
|
||||
POSTGRES_DB: facilmap
|
||||
healthcheck:
|
||||
test: pg_isready -d $$POSTGRES_DB
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
"mysql2": "^3.6.5",
|
||||
"node-cron": "^3.0.3",
|
||||
"p-throttle": "^6.1.0",
|
||||
"pg": "^8.11.3",
|
||||
"sequelize": "^6.35.2",
|
||||
"socket.io": "^4.7.2",
|
||||
"string-similarity": "^4.0.4",
|
||||
|
@ -79,7 +80,6 @@
|
|||
"@types/string-similarity": "^4.0.2",
|
||||
"cpy-cli": "^5.0.0",
|
||||
"debug": "^4.3.4",
|
||||
"pg": "^8.11.3",
|
||||
"rimraf": "^5.0.5",
|
||||
"tsx": "^4.7.0",
|
||||
"typescript": "^5.3.3",
|
||||
|
|
Ładowanie…
Reference in New Issue