Skip to content

CM-235: Fixed json_schema extension and added CI check for PR #17

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

Merged
merged 4 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
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
29 changes: 29 additions & 0 deletions .github/workflows/docker-build-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Docker Build Check

on:
pull_request:
branches:
- main
- develop

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Build Docker image
run: docker build .

- name: Check Docker image build status
run: |
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Docker image build failed."
exit 1
else
echo "Docker image build successful."
exit 0
fi
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM postgres:13-alpine

# Script to detect whether the database has finished initializing
COPY ["true_isready.sh", "/usr/local/bin/"]
COPY ["database scripts/00_dump.sql", "database scripts/0[2345]_*.sql", "database scripts/demo_db.sql", "/docker-entrypoint-initdb.d/"]
COPY ["database scripts/00_dump.sql", "database scripts/0[2345]_*.sql", "database scripts/demo_db.sql", "database scripts/json_schema_extension.sql", "/docker-entrypoint-initdb.d/"]

# Install https://github.com/gavinwahl/postgres-json-schema/
# extension that allows validation of jsonb fields against jsonschema
Expand Down
1 change: 1 addition & 0 deletions database scripts/json_schema_extension.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE EXTENSION "postgres-json-schema";
3 changes: 0 additions & 3 deletions install_postgres_json_schema_extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@ apk add postgresql-client
/bin/mkdir -p '/usr/local/share/postgresql/extension'

chmod 666 /usr/local/share/postgresql/extension/postgres-json-schema.control
# Add extension to PostgreSQL
# Assuming you're operating in the psql shell
psql -U $POSTGRES_USER -d $POSTGRES_DB -c "CREATE EXTENSION \"postgres-json-schema\";"