Skip to content

Commit

Permalink
Finish feature/CM-235
Browse files Browse the repository at this point in the history
CM-235: Fixed json_schema extension and added CI check for PR
  • Loading branch information
dragos-dobre authored Jul 18, 2023
2 parents bd0594e + 8b7966b commit db3dc86
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
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\";"

0 comments on commit db3dc86

Please sign in to comment.