Skip to content

Commit

Permalink
improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Nov 25, 2024
1 parent eac9b99 commit 815c00e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,27 @@ jobs:
- name: Start care docker containers 🐳
run: |
cd care
echo DISABLE_RATELIMIT=True >> docker/.prebuilt.env
echo "CORS_ALLOWED_ORIGINS=\"[\\\"http://localhost:4000\\\"]\"" >> docker/.prebuilt.env
echo JWKS_BASE64=\"$(cat ../.github/runner-files/jwks.b64.txt)\" >> docker/.prebuilt.env
docker compose -f docker-compose.yaml -f docker-compose.pre-built.yaml up -d db
(docker compose up --wait db &)
docker compose exec db sh -c "createdb -U postgres care"
# load the db dump from the artifact if it exists else do the usual
set -e
{
set -e
archive_download_url=$(curl -sf "https://api.github.com/repos/ohcnetwork/care/actions/artifacts?name=care-db-dump" | jq -r '.artifacts[0].archive_download_url')
curl -Lf -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -o care-db-dump.zip "$archive_download_url"
unzip care-db-dump.zip
make load-db
make docker_config_file=docker-compose.pre-built.yaml up
} || {
echo "An error occurred during database download and setup."
echo "Falling back to loading dummy data."
make docker_config_file=docker-compose.pre-built.yaml up load-dummy-data
}
cd ..
- name: Determine PR Origin
Expand Down

0 comments on commit 815c00e

Please sign in to comment.