Environments

PAGE UNDER REVIEW

Please do not implement the following conventions until this banner as been removed. These are being established and have been made visible for your review during this process!

To provide feedback please email both :
Diana.L.Hanbali@usace.army.mil  and Charles.r.graham@usace.army.mil 



Three distinct environments have been created for use with Water Management website development. 


These environments each provide unique and useful functions to both migration and future development. Below is a table outlining their use and associated files.




EnvironmentData StatusEnv FileProcessEnv Variables (in file)

Production

Data from T7, Time Series data filtered through TS Group.env.productionGitHub Action

VITE_CDA_API_ROOT="https://cwms-data.usace.army.mil/cwms-data"
VITE_CDA_OFFICE="SWT"

TestData from T7, no filtering.env.testGitHub Action

VITE_CDA_API_ROOT="https://cwms-data-test.cwbi.us/cwms-data"
VITE_CDA_OFFICE="SWT"

DevelopmentData from OpenDCS and/or Batch if office is setup.env.developmentGitHub Action

VITE_CDA_API_ROOT="https://water.dev.cwbi.us/cwms-data"
VITE_CDA_OFFICE="SWT"

Local (workstation)Depends on which CDA instance you target in the environment, if you setup a local Docker instance it will only have what you decide to load into it/comes with the default schema.env.development.localnpm run dev

VITE_CDA_API_ROOT="/cwms-data"
VITE_CDA_OFFICE="SWT"

For further reading on how vite  handles environments please see: https://vite.dev/guide/env-and-mode.html

For seeing how to make use of /cwms-data  in your Local workstation environment please see: Setting up Vite Proxy


For a full listing of water management sites deployed in these environments please see the Listings.


To get started using these environments districts must do the following:


  1. Establish and/or rename to cwbi-dev, cwbi-test, cwbi-prod branches
  2. Create files .env.production , .env.test , and .env.development  (making sure to include the leading period)
  3. Add the listed variables above to the files, replacing OFFICE with your office's 3 letter

    You must PREFIX_ the env variable with VITE_ or it will be ignored with vite.


  4. Hook the requisite files into each of their CI/CD processes in the GitHub Actions by
    1. Edit the target action for the environment, i.e. cwbi-dev-build-push.yml  for development
    2. Make sure on the npx vite build  line that you have:

              run: npx vite build --mode development

  5. Repeat this for cwbi-prod-build-push.yml  and cwbi-test-build-push.yml 


To read more on the setup of the GitHub Actions, CI/CD, and other such design please visit the Quick Start Guide.