Hosting Infrastructure
Bragi offers flexible deployment options to suit a variety of IT environments. There are two primary routes for hosting the Bragi WebApp and the Bragi Schedulers:
Configuring a Deployment
Every Bragi component reads its settings from the same sources, applied in order. Later sources win:
appsettings.jsonappsettings.{Environment}.json, where{Environment}is the name set byDOTNET_ENVIRONMENTfor the Scheduler running as a Windows Service, or byASPNETCORE_ENVIRONMENTfor the WebApp and the Scheduler Web APIEnvironment variables
Command-line arguments
Overriding Settings With Environment Variables
Any setting can be supplied as an environment variable by joining the configuration path with a double underscore. This is the usual way to configure a containerised deployment, where the settings files are baked into the image:
An environment variable overrides the same setting in the files, so an image built with development defaults can be pointed at a production database without rebuilding it.
Choosing Which Environments a Scheduler Runs
A Scheduler starts a worker for every environment code it is given. Codes can be supplied either singly or as a list:
Setting either of these as an environment variable replaces the codes in the settings files rather than adding to them. This matters for containers: the image bakes in whatever codes its appsettings.json shipped with, and without replacement a Scheduler deployed to production would keep starting workers for the development and test environments as well, running their scheduled jobs.