Skip to content
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

Wfprev 66 a #191

Closed
wants to merge 5 commits into from
Closed
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
6 changes: 4 additions & 2 deletions .github/workflows/mvn-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ jobs:
export MAVEN_OPTS="-Xmx3072m -XX:MaxMetaspaceSize=512m"
export NODE_OPTIONS="--max-old-space-size=4096"
mvn --settings ${{ inputs.COMPONENT_TYPE }}/mvn_settings/settings.xml --batch-mode --update-snapshots -f ${{ inputs.COMPONENT_TYPE }}/pom.xml -Drepo.login=${{ secrets.IDIR_AS_EMAIL }} -Drepo.password=${{ secrets.IDIR_PASSWORD }} -DskipTests package


cd ${{ inputs.COMPONENT_TYPE }}/wfprev
npm install
npm run build -- --base-href="/pub/wfprev/"

- name: Copy files to neccessary folders
run: mkdir staging && cp ${{ inputs.COMPONENT_TYPE }}/${{ inputs.COMPONENT_NAME }}/target/*.war staging

Expand Down
1 change: 1 addition & 0 deletions client/wfprev-war/src/main/angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"baseHref": "/pub/wfprev/",
"outputPath": "dist/wfprev",
"index": "src/index.html",
"main": "src/main.ts",
Expand Down
2 changes: 1 addition & 1 deletion client/wfprev-war/src/main/angular/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Wfprev</title>
<base href="/pub/wfprev/">
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
Expand Down
62 changes: 62 additions & 0 deletions db/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# WFPrev Local PostGIS Setup

This guide will help you build a local instance of PostGIS, set up the database, and apply the model using Liquibase from the change log.

## Prerequisites

- Docker installed on your local machine.
- `Dockerfile.liquibase.local`, `main-changelog.json`, and the `scripts` folder available in your repository.

## Project Structure

- **`main-changelog.json`**: The main Liquibase changelog file, which includes the following changes:
- Creates logins using SQL scripts.
- Creates roles.
- Creates the `wfprev` schema.
- Adds required extensions.
- **`Dockerfile.liquibase.local`**: Dockerfile for running Liquibase commands.
- **`scripts` folder**: Contains the SQL scripts for various database changes as referenced in `main-changelog.json`.

## Step 1: Pull and Run PostGIS

1. **Pull the PostGIS Image**:

```bash
docker pull postgis/postgis:16-3.4

2. **Run the PostGIS Containe**:

```bash
docker run --name wfprev-postgres -e POSTGRES_USER=wfprev -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgis/postgis:16-3.4

## Step 2: Find the IP Address

1. **Get the Container ID:** :
docker ps

2. **Inspect the Container for IP Address:** :
docker inspect <container_id>

## Step 3: Set Up and Run Liquibase

1. **Build the Liquibase Docker Image** :
Create a Dockerfile.liquibase.local with the following content:

FROM liquibase/liquibase
COPY ./scripts ./scripts
COPY ./main-changelog*.json .
COPY ./liquibase.properties .

ENTRYPOINT [ "sh", "-c", "liquibase $COMMAND $TARGET_LIQUIBASE_TAG --changelog-file=$CHANGELOG_FILE -Dschemaname=$SCHEMA_NAME" ]

Build the Liquibase Docker image:
docker build -t liquibase -f Dockerfile.liquibase.local .

2. ** Run Liquibase Update:**:

docker run --rm liquibase \
--url=jdbc:postgresql://<your_postgis_ip>:5432/wfprev \
--changelog-file=main-changelog.json \
--username=wfprev \
--password=password \
update
28 changes: 0 additions & 28 deletions db/README.txt

This file was deleted.

Loading