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.
| Environment | Data Status | Env File | Process | Env Variables (in file) |
|---|---|---|---|---|
Production | Data from T7, Time Series data filtered through TS Group | .env.production | GitHub Action | VITE_CDA_API_ROOT="https://cwms-data.usace.army.mil/cwms-data" |
| Test | Data from T7, no filtering | .env.test | GitHub Action | VITE_CDA_API_ROOT="https://cwms-data-test.cwbi.us/cwms-data" |
| Development | Data from OpenDCS and/or Batch if office is setup | .env.development | GitHub Action | VITE_CDA_API_ROOT="https://water.dev.cwbi.us/cwms-data" |
| 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.local | npm run dev | VITE_CDA_API_ROOT="/cwms-data" |
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:
- Establish and/or rename to cwbi-dev, cwbi-test, cwbi-prod branches
- Create files
.env.production,.env.test, and.env.development(making sure to include the leading period) - 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.
- Hook the requisite files into each of their CI/CD processes in the GitHub Actions by
- Edit the target action for the environment, i.e.
cwbi-dev-build-push.ymlfor development - Make sure on the
npx vite buildline that you have:run: npx vite build --mode development
- Edit the target action for the environment, i.e.
- Repeat this for
cwbi-prod-build-push.ymlandcwbi-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.