This is a mapping application providing high-volume receiving site registration to Indigenous Nations, municipalities and other interested parties. Subscribe for notifications in your area!
-
BC users in BC submit soil relocation information using a CHEFS form (link coming soon)
-
This script is run on a schedule
-
Data from CHEFS forms is uploaded to ArcGIS Online (AGOL) and soil movement subscribers are notified
-
This information is displayed in the frontend, which is be made public soon
The Project uses OpenShift CronJobs
The template is here
The workflow file for build and deploy is here.
GitHub secrets are passed as environment variables through a configmap.
The CHES API Key is generated from Postman, by providing the username(client_id) and (client_secret). That populates as environment variable(CHES_API_OAUTH_SECRET) in the pipeline.
Cronjob times are in UTC, like the OpenShift servers.
NOTE: This application is the middle layer between CHEFS forms and AGOL, neither of which offer non-PROD environments. Once our application hits production and becomes publicly available this approach will be revisited.
-
Clone this repository and make changes in feature branches (e.g. feat/abc). Submit changes in Pull Requests against the main branch.
-
Once the code is reviewed and approved, merge it to main branch.
-
Now the code can be deployed to TEST/PROD environments.
- PROD Deployment
-
Go to the Actions tab, click on Build And Add Job to Openshift Prod and trigger a build
- Provide a unique tag number. Check the releases/tags and increment accordingly
- Please make sure you are only entering the number without the
release
prefix, if the latest release showsrelease/1.0.0
, your input should be1.0.1
- Click on Run workflow button
-
The workflow will:
-
Build and push a container image to the GitHub Container Registry (GHCR.io), tagged with the release you provided
-
Create the matching GitHub release/tag
-
Deploy code and configmap changes to OpenShift
-
-
A cronjob will be deployed in the PROD environment using the new image
-
- TEST Deployment
-
Go to the Actions tab, click on Build And Add Job to Openshift Test and trigger the job. The workflow will, do the following:
- Build and push a container image to the GitHub Container Registry (GHCR.io), tagged with
latest
- Deploy code and configmap changes to OpenShift, reading from github test environment
- A cronjob will be deployed in the PROD environment using the new image
- Build and push a container image to the GitHub Container Registry (GHCR.io), tagged with
-
- PROD Deployment
-
Environment variables are supplied to the container through the configmap using GitHub Secrets
-
Environment varialbes must be updated only through GitHub Secrets, our source of truth
-
The cronjob is scheduled to run daily at 8 AM UTC (1AM PDT)
-
Cronjobs can be triggered manually, usually for testing, with the One-Time Job steps below
Sometimes waiting for a scheduled cronjob is not practical. These steps explain how to run a one-time job.
-
Visit the appropriate OpenShift console
-
Copy the spec.spec.containers section of the cronjob template, including the container's TAG
-
Go to Jobs menu in the same namespace and click Create Job, located on the right hand side
-
Populate the job, and below, and click Create
-
Name:
sris-1-of-job-$name
, using your own name for $name -
Containers: using the code copied in step 2, above
-
-
Verify that a new container is running your new job
-
Finally, delete this and any other completed jobs
- Create a new GitHub secret in the repository
- Modify/update two places in the workflow file located here
.github/workflows/ci-openshift-prod.yaml
.- Add the secret as env variable ENV_VAR_NAME=${{ secrets.SECRET_NAME }}, ex: https://github.com/bcgov/nr-soils-relocation/blob/main/.github/workflows/ci-openshift-prod.yaml#L25
- Pass the env variable as a parameter to the job deployment template `-p CONFIG_NAME=${{env.ENV_VAR__NAME}}, ex: https://github.com/bcgov/nr-soils-relocation/blob/main/.github/workflows/ci-openshift-prod.yaml#L94
- Add the corresponding entry into the openshift deploy at 2 places, file located here
openshift/sris-schedule-job.yml
- The parameter ,it should have the same name as in the config name in step 2.2 , ex: https://github.com/bcgov/nr-soils-relocation/blob/main/openshift/sris-schedule-job.yml#L25
- Then the parameter is added as a config map, ex: https://github.com/bcgov/nr-soils-relocation/blob/main/openshift/sris-schedule-job.yml#L89
- Once this is completed. the new secret is now available as configmap entry to the job.