The goal of the BC Wildfire Service (BCWS) Prevention Program is to reduce the negative impacts of wildfire on public safety, property, the environment and the economy using the seven disciplines of the FireSmart program.
For a streamlined setup including automated builds and data restoration, use the unified shell scripts in the docker folder.
# 1. Grant execution permissions
chmod +x docker/*.sh
# 2. Start the local stack and restore seed data
./docker/start-local.sh -rSee the Local Dev README for full prerequisites and Windows setup instructions.
You can start the full system with the following command:
- Create a .env file in the root of the project with the following content:
WFPREV_DATASOURCE_USERNAME=wfprev
WFPREV_DATASOURCE_PASSWORD=***
WFPREV_CLIENT_ID=WFNEWS-REST
WFPREV_CLIENT_SECRET=***
WEBADE_OAUTH2_CHECK_TOKEN_URL=https://wfappsi.nrs.gov.bc.ca/pub/oauth2/v1/check_token
WEBADE_OAUTH2_CHECK_AUTHORIZE_URL=https://wfappsi.nrs.gov.bc.ca/ext/oauth2/v1/oauth/authorize
SPRING_MAIN_ALLOW_BEAN_DEFINITION_OVERRIDING=true
WFPREV_DB_PASSWORD=***
POSTGRES_PASSWORD=**
WFPREV_BASE_URL=http://localhost:8080
WFPREV_GDB_FUNCTION_NAME=wfprev-gdb-dev
- Then run this command
docker compose up- This will start the database, liquibase and the backend service
- If you want to also run the API (With GraalVM), run the following command:
docker compose --profile api up - to get GraalVM re-register, run :
docker compose --profile api up --build - To wipe out the db on your local
docker compose down -v
- NOTE - Windows users may have to fix the line endings in the server/wfprev-api/mvnw file. The simplest way to do this is to run the following command:
Open the mvnw file in a text editor (like VS Code or Notepad++).
Convert the line endings:
• VS Code: Look for the line ending selector in the bottom-right corner and change it to LF.
• Notepad++: Use the menu Edit > EOL Conversion > Unix (LF).
You can create a database instance via
docker pull postgis/postgis:17-3.6
docker run --name wfprev-postgres \
--env-file .env.local \
-e POSTGRES_USER=wfprev \
-p 5432:5432 \
-d postgis/postgis:17-3.6
Note: Mac users will get the following error, jsut ignore for now WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested f0de92debad131b48e2d72a9d211bafaa2b8bcb800e5077bb59f3225e5729086
And build the database model with Liquibase:
cd db
docker build -t liquibase -f Dockerfile.liquibase.local .
docker run --rm \
--env-file .env.local \
liquibase \
/bin/bash -c 'liquibase \
--url=jdbc:postgresql://host.docker.internal:5432/wfprev \
--changelog-file=main-changelog.json \
--username=wfprev \
--password=$WFPREV_DB_PASSWORD \
update'
The db/.env.local file should have the following content:
WFPREV_DB_PASSWORD=***
POSTGRES_PASSWORD=***
We typically run the API from our IDE but you can find more detailed information in the README at server/wfprev-api
Deployments to TEST and PROD happen when you publish a GitHub release. The release type and the tag name decide where it goes:
| Release type | Workflow | Tag contains | Deploys to |
|---|---|---|---|
| Pre-release | prerelease.yml | -rc |
TEST (wftst) |
| Full release | release.yml | -release |
PROD (wfprd) |
Neither workflow builds anything. Each one finds the API, Liquibase, GDB extractor and report generator images tagged with the commit SHA the release tag points at, re-tags them with the release tag (GHCR and ECR), then runs Terragrunt apply with Liquibase and builds the UI. The images must already exist for that exact commit.
- Commits on
main: merging a PR runsbuild-full-environment, so the images already exist. - Commits on a release branch (e.g.
release/1.4.0): merging PRs into it does not build anything. Go to Actions → build-full-environment → Run workflow, pick the release branch and wait for it to go green.- This also deploys the branch to INT as
latest. To leave INT alone, run these on the branch instead:mvn-build(wfprev-api,server),liquibase-build,node-build(wfprev-gdb-extractor) andreport-generator-image-build.
- This also deploys the branch to INT as
- Check that the image build above has finished for the commit you're releasing (
git fetch && git rev-parse origin/release/1.4.0). - Go to GitHub → Releases → Draft a new release.
- Choose a tag: type a new tag following the existing pattern, e.g.
v1.4.0-rc2(v1.4.0-rc1.3for a small re-spin). Set Target to the release branch. - Title: the tag name. Click Generate release notes with the previous tag set to the last rc.
- Tick Set as a pre-release.
- Click Publish release and follow the
prereleaserun in Actions:retag-images→deploy-wftst→wfprev-ui-tst. - Smoke-test TEST.
If a job fails for a transient reason, use Re-run failed jobs on that run rather than deleting and recreating the release.
- Find the rc that passed testing (e.g.
v1.4.0-rc2). PROD must get that exact commit, so don't target the branch head if anything has merged since. - Create the prod tag on the same commit and push it (pushing a tag doesn't start any workflow):
git fetch --tags git tag v1.4.0-release v1.4.0-rc2^{commit} git push origin v1.4.0-release - Go to Releases → Draft a new release and choose the existing tag
v1.4.0-release. - Title: the version (e.g.
v1.4.0). Generate release notes with the previous tag set to the last prod tag (e.g.v1.3.0-release) so the notes cover the whole release. - Leave Set as a pre-release unticked and Set as the latest release ticked.
- Click Publish release and follow the
releaserun in Actions:check-images→retag-images+validate-images→deploy-prod→wfprev-ui. - Smoke-test PROD, then merge the release branch back to
mainif it has fixesmaindoesn't.
- Publishing is the deploy.
wfprdhas no required-reviewer approval, so nothing pauses the run once you publish. Use Save draft if someone needs to review it first; drafts don't start anything. - Don't promote an rc by unticking "pre-release". That fires
releasedwith an-rctag: the images get re-tagged butdeploy-prodis skipped, so nothing reaches PROD and the rc becomes "Latest". Always create a new-releasetag. - The prod tag must contain
-release. A plainv1.4.0tag won't deploy. - Liquibase runs against PROD and changesets can't be undone. Make sure there's a recent RDS snapshot first.
- Editing a release does nothing. Neither workflow listens for edits, so changing the notes or target later won't redeploy.