Skip to content

Commit db3dc86

Browse files
authored
Finish feature/CM-235
CM-235: Fixed json_schema extension and added CI check for PR
2 parents bd0594e + 8b7966b commit db3dc86

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Docker Build Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- develop
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
17+
- name: Build Docker image
18+
run: docker build .
19+
20+
- name: Check Docker image build status
21+
run: |
22+
exit_code=$?
23+
if [ $exit_code -ne 0 ]; then
24+
echo "Docker image build failed."
25+
exit 1
26+
else
27+
echo "Docker image build successful."
28+
exit 0
29+
fi

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM postgres:13-alpine
22

33
# Script to detect whether the database has finished initializing
44
COPY ["true_isready.sh", "/usr/local/bin/"]
5-
COPY ["database scripts/00_dump.sql", "database scripts/0[2345]_*.sql", "database scripts/demo_db.sql", "/docker-entrypoint-initdb.d/"]
5+
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/"]
66

77
# Install https://github.com/gavinwahl/postgres-json-schema/
88
# extension that allows validation of jsonb fields against jsonschema
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE EXTENSION "postgres-json-schema";

install_postgres_json_schema_extension.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,3 @@ apk add postgresql-client
1818
/bin/mkdir -p '/usr/local/share/postgresql/extension'
1919

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

0 commit comments

Comments
 (0)