Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update : Docker compose test #47

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 35 additions & 8 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ on:
- cron: '0 0 * * *'

env:
WALLET_BACKEND_PORT: 3000
ISSUER_API_PORT: 3001
VERIFIER_API_PORT: 3002
WALLET_FRONTEND_PORT: 3003
WEB_PORTAL_PORT: 3004
VC_REPO_PORT: 3005
WALLET_BACKEND_PORT: 7001
ISSUER_API_PORT: 7002
VERIFIER_API_PORT: 7003

jobs:
docker-compose:
Expand All @@ -27,8 +24,38 @@ jobs:
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Pull Docker Images
run: docker-compose pull
- name: Run Docker Compose
run: docker-compose up --abort-on-container-exit
run: docker-compose up -d
- name: Check container health
id: healthcheck
run: |
for container in wallet-api issuer-api verifier-api waltid-web-wallet web-portal vc-repo db phpmyadmin caddy; do
container_status=$(docker inspect --format='{{.State.Health.Status}}' $container)
if [ "$container_status" != "healthy" ]; then
echo "::error ::Container $container is not healthy"
exit 1
fi
done
- name: Check container logs for errors
run: |
for container in wallet-api issuer-api verifier-api waltid-web-wallet web-portal vc-repo db phpmyadmin caddy; do
if docker logs $container 2>&1 | grep -q "ERROR"; then
echo "::error ::Error found in container $container logs"
exit 1
fi
done
- name: Check application endpoints
run: |
for container_port in ${{ env.WALLET_BACKEND_PORT }} ${{ env.ISSUER_API_PORT }} ${{ env.VERIFIER_API_PORT }}; do
if [ -z "$container_port" ]; then
continue
fi
response=$(curl --silent --fail --output /dev/null --write-out '%{http_code}' http://localhost:$container_port)
if [ "$response" != "200" ]; then
echo "::error ::Application endpoint returned an error: $response"
exit 1
fi
done
Loading