-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release/23.10
- Loading branch information
Showing
9 changed files
with
185 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: publish develop image | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
publish-docker-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build the pgsql EMPTY Docker image | ||
run: | | ||
docker build . --tag ghcr.io/openimis/openimis-pgsql:develop-base --target base | ||
docker push ghcr.io/openimis/openimis-pgsql:develop-base | ||
- name: Build the pgsql DEMO Docker image | ||
run: | | ||
docker build . --tag ghcr.io/openimis/openimis-pgsql:develop | ||
docker push ghcr.io/openimis/openimis-pgsql:develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
FROM postgres:13-alpine | ||
FROM postgres:13-alpine AS base | ||
|
||
# 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/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 | ||
COPY ["install_postgres_json_schema_extension.sh", "install_postgres_json_schema_extension.sh"] | ||
RUN chmod u+x install_postgres_json_schema_extension.sh | ||
RUN ./install_postgres_json_schema_extension.sh | ||
|
||
FROM base AS demo | ||
COPY ["database scripts/demo_db.sql", "/docker-entrypoint-initdb.d/"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE EXTENSION "postgres-json-schema"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
apk add --update make | ||
apk add --update git | ||
|
||
# Clone the repository | ||
git clone https://github.com/gavinwahl/postgres-json-schema/ | ||
|
||
apk add libpq-dev | ||
# Move into the directory | ||
cd postgres-json-schema | ||
|
||
# Build the extension | ||
make & make install | ||
|
||
|
||
apk add postgresql-client | ||
|
||
/bin/mkdir -p '/usr/local/share/postgresql/extension' | ||
|
||
chmod 666 /usr/local/share/postgresql/extension/postgres-json-schema.control |
Oops, something went wrong.