Using the quickstart openshift template, this repository contains a pull request based deployment pipeline for configuration and setup of a hydrological analytical database.
This is a work in progress, and is in early days for development.
Initially its attempting to implement similar functionality as the Yukon Governments github repo
Includes:
- docker-compose file for setting up an environment locally for development.
- pull request pipeline with dev/test deployments
- Windows subsystem for linux, ideally running ubuntu
- Docker and Docker compose
- Openshift cli tools
- Access to an openshift namespace
A link to how I configure WSL / Docker / Docker compose, don't bother with the brew or anything other than WSL / Docker / Docker comose sections
The openshift CLI tools can be downloaded from the openshift console, then go to the ? icon at the top right, and select
the option command line tools
Other optional installs that are likely to help:
- VSCode
- VSCode docker extension
Create the database and run the migrations:
docker compose up migrations
Once the command has completed, you should be able to connect to the database using the credentals described in the docker-compose.yaml file.
The docker compose will create a postgres database, and run the migrations using flyway.
Migration files are stored in the directory: /migrations/sql
To add more migrations simply follow the naming convention. V__.sql Note: there are two underscore characters between number and description.
-
go to openshift web app and login
-
authenticate your cli by clicking your username icon at the top right corner and selecting
copy login command -
having copied the login command, paste it into a wsl terminal to authenticate
-
make sure you are in the correct namespace
oc projectsto change to a new project it will beoc project <project license plate> -
list the running pods
oc get podslook for a database pod that will have a name like
nr-rfc-db-<pr number>-bitnamei-pg-0 -
create a ssl tunnel to the openshift database
oc port-forward <pod with bitnami-pg name in it> <localport>:<remote port>usually I change the local port to something like 5433 in case i already have a postgres instance running via docker compose on port 5432. In this scenario the command would look something like:
oc port-forward nr-rfc-db-3-bitnami-pg-0 5433:5432