-
Notifications
You must be signed in to change notification settings - Fork 4
Deployment
This page describes how we do deployment to our development, testing, and production environments.
- Web server: https://citycatalyst.openearth.dev/
- Global API server: https://ccglobal.openearth.dev/
- Docker tag: "latest"
This environment tracks the latest changes in the develop
branch. It may be unstable during regular development sprints.
When a new commit is pushed to the develop
branch, one or more GitHub actions occurs.
- global-api-develop: Runs if Global API files are changed. It builds the Global API
ghcr.io/open-earth-foundation/citycatalyst-global-api:latest
Docker image, runs migration scripts, and redeploys the development global api. - web-develop: Runs if Web UI or API files are changed. It builds the Web app
ghcr.io/open-earth-foundation/citycatalyst:latest
Docker image, runs migration scripts, seeders, and syncs, and redeploys the Web app.
- Web server: https://citycatalyst-test.openearth.dev/
- Global API server: https://ccglobal-test.openearth.dev/
- Docker tag: "main"
This environment is for acceptance testing by our product team and QA by our QA partners.
A release candidate version is made at the end of each sprint (right before demo).
To make a release candidate, take the following steps:
- In the
develop
branch, in theapp
directory, runnpm version
to find out the current development version -- usually "X.Y.0-dev" or "X.Y.0-dev.0". - Run
npm version vX.Y.0-rc.0
to update the package files to have the release candidate version. - Commit the package files, package.json and package-lock.json
- Run
git tag vX.Y.0-rc.0
to tag the repo at this level. -
git push
to push to GitHub. - In the app directory, run
npm version vX.Z.0-dev.0
where Z = Y + 1. (In other words, increment the minor version). - Commit the package files, package.json and package-lock.json.
- Run
git tag vX.Z.0-dev.0
to tag the repo at the beginning of the next development cycle. -
git push
to push to GitHub. -
git push --tags
to push tags, too. git checkout main
-
git merge vX.Y.0-rc.0
will merge the release candidate. -
git push
should push tomain
and deploy the test code.
Deployment happens when there is a new commit pushed to main
. These scripts run:
- global-api-test: Runs if Global API files are changed in the
main
branch. It builds the Global APIghcr.io/open-earth-foundation/citycatalyst-global-api:main
Docker image, runs migration scripts, and redeploys the development global api. - web-test: Runs if Web UI or API files are changed. It builds the Web app
ghcr.io/open-earth-foundation/citycatalyst:main
Docker image, runs migration scripts, seeders, and syncs, and redeploys the Web app.
During testing, there may be bugs that are identified and need to be fixed before pushing to production. In this case, you can either make the changes in the main
branch and push directly, or you can make them in the develop
branch and then git cherry-pick
them into main.
After making a change to main
, you should increment the release candidate number rc.0
, rc.1
, rc.2
, etc. using npm version
and git tag
.
- Web server: https://citycatalyst.io/
- Global API server: https://api.citycatalyst.io/
- Docker tag: X, X.Y, "stable" (see below)
Our production version is the one used by real customers and for demos. It can be about 3-4 weeks behind the develop
branch, depending how long the sprint cycle and test process are.
To release the test version to production, do the following:
- In the
main
branch, in theapp
directory, run thenpm version
command to get the current release-candidate version, likeX.Y.Z-rc.N
. - Run
npm version vX.Y.Z
, without a pre-release tag. - Commit packages files.
- Run
git tag vX.Y.Z
. git push main
-
git push --tags
.
Deployment happens when there is a new tag pushed without a pre-release tag (the "-something" at the end).
- global-api-test: Runs if Global API files are changed in the
main
branch. It builds the Global APIghcr.io/open-earth-foundation/citycatalyst-global-api:stable
and version-tagged Docker image, runs migration scripts, and redeploys the development global api. - web-test: Runs if Web UI or API files are changed. It builds the Web app
ghcr.io/open-earth-foundation/citycatalyst:stable
and version tagged Docker image, runs migration scripts, seeders, and syncs, and redeploys the Web app.
The Kubernetes deployments use the version number tagged images -- so compatible newly-pushed images will deploy, but incompatible versions (with a major version change) won't deploy automatically. Don't use "stable", use the versioned tags.
If there are hot patches needed for production, take these steps:
- Commit to main.
- In the
main
branch, in theapp
directory, run thenpm version
command to get the current release version, likeX.Y.Z
. - Run
npm version X.Y.W-rc.0
, where W = Z + 1 (increment the patch version) and commit -
git tag vX.Y.W-rc.0
to tag it - Push to main (will deploy to test)
- Test it.
- If additional changes are needed, make additional release candidates after each commit.
- Once the tests are correct, push to production as described above.