See the Browse doc for some explanation of how the code is laid out.
RotaNG has the following environments
rota-ng-staging.google.com@appspot.gserviceaccount.com This gives that the staging environment can not change rotation calendars in prod if not specifically allowed.chromiumcalendar@gmail.com token. This gives that fetching legacy calendars works in the staging environment. // IsProduction is true if the service is running in production.
func (h *State) IsProduction() bool {
return h.prodENV == "production"
}
// IsStaging is true if the service is running in staging.
func (h *State) IsStaging() bool {
return h.prodENV == "staging"
}
// IsLocal is true if the service is running in the local dev environment.
func (h *State) IsLocal() bool {
return h.prodENV == "local"
}
RotaNG uses Makefiles to deploy to the different environments.
npm to fetch it's webmodules. apt install npmFrom the rotang folder.
make devserver Spins up a local development server on port 8080.make devserver-remote Local devserver that also listens to *:8080 -> Can be reached over the network.make deploy-staging Pushes to the staging environment.make deploy-prod Pushes to the prod environment.If changes are made to the cron.yaml file. It needs to be deployed to take effect.
cloud app deploy cmd/app/cron.yaml --project google.com:rota-ng-staging
cloud app deploy cmd/app/cron.yaml --project rota-ng
The Development environment does not run cron jobs, they can be triggered manually but just accessing the URLs as an admin. eg https://localhost:8080/cron/eventupdate with a browser or wget/curl.
If new queries are made to Datastore the index.yaml file is automatically updated by the development server. When that happens the index needs to be pushed. If the index is not pushed/built, using the new query will fail. While the index is built the query might also fail.
gcloud app deploy cmd/app/index.yaml --project google.com:rota-ng-staging
gcloud app deploy cmd/app/index.yaml --project rota-ng
The staging and production environment backs up the Rotation configuration and shifts information once per day to GC storage buckets.
See Exporting and Importing Entities for further information on how to access the information using the gcloud command.
Bucket name rota-ng-staging-backup
Bucket name rota-ng-production-backup