Skip to content

Commit

Permalink
wip: cleanup code quality workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-va committed Nov 5, 2024
1 parent dbb45b1 commit 74d889c
Show file tree
Hide file tree
Showing 11 changed files with 282 additions and 302 deletions.
25 changes: 25 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Application
APP_PORT=3000

# Cognito
COGNITO_AWS_REGION=eu-west-1
COGNITO_CLIENT_ID=10h1tga4i933buv25lelalmtrn
COGNITO_POOL_ID=eu-west-1_dbfEb2FuH

# S3
S3_AWS_REGION=eu-west-1
AWS_ACCESS_KEY_ID=minio
AWS_SECRET_ACCESS_KEY=minio123
S3_BUCKET=ngmpub-userdata-local
PROJECTS_S3_BUCKET=ngmpub-project-files-local
S3_ENDPOINT=http://minio:9000

# Database
PGUSER=www-data
PGPASSWORD=www-data
PGHOST=db
PGPORT=5432
PGDATABASE=swissgeol-local

# sqlx
DATABASE_URL=postgres://${PGUSER}:${PGPASSWORD}@${PGHOST}:${PGPORT}/${PGDATABASE}
22 changes: 22 additions & 0 deletions .github/scripts/wait_for_service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!bash

MAX_RETRY_COUNT=10
SERVICE_NAME="$1"

if [ ! -n "$SERVICE_NAME" ]; then
echo "Usage: wait_for_container.sh <service_name>"
exit 1
fi

for i in $(seq 1 $MAX_RETRY_COUNT); do
if [ "$(docker inspect -f '{{.State.Health.Status}}' "swissgeol-viewer-app-$SERVICE_NAME-1")" == "healthy" ]; then
echo "Service $SERVICE_NAME is healthy!"
exit 0
else
echo "Waiting for $SERVICE_NAME to be healthy... (attempt $i of $MAX_RETRY_COUNT)"
sleep 10
fi
done

echo "Service $SERVICE_NAME did not become healthy in time."
exit 1
Loading

0 comments on commit 74d889c

Please sign in to comment.