Skip to content

Commit

Permalink
Use postgres authentication and healthchecks
Browse files Browse the repository at this point in the history
  • Loading branch information
mbocevski committed Jan 16, 2021
1 parent 440a984 commit 9f53b71
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,26 @@ jobs:
services:
postgresql:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

ckan-solr:
# Workflow level env variables are not addressable on job level, only on steps level
# image: ghcr.io/keitaroinc/ckan-solr-dev:{{ env.CKANVERSION }}
Expand Down
4 changes: 2 additions & 2 deletions bin/setup-ckan.bash
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ pip install -r dev-requirements.txt
cd -

echo "Creating the PostgreSQL user and database..."
sudo -u postgres psql -c "CREATE USER ckan_default WITH PASSWORD 'pass';"
sudo -u postgres psql -c 'CREATE DATABASE ckan_test WITH OWNER ckan_default;'
PGPASSWORD=postgres sudo -u postgres psql -h localhost -c "CREATE USER ckan_default WITH PASSWORD 'pass';"
PGPASSWORD=postgres sudo -u postgres psql -h localhost -c 'CREATE DATABASE ckan_test WITH OWNER ckan_default;'

echo "Initialising the database..."
cd ckan
Expand Down

0 comments on commit 9f53b71

Please sign in to comment.