diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 14ad185..064b177 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,6 +24,7 @@ jobs: env: PROJECT_PATH: /go/src/github.com/analogj/scrutiny CGO_ENABLED: 1 + SCRUTINY_WEB_INFLUXDB_HOST: influxdb steps: - name: Git run: | diff --git a/webapp/backend/pkg/config/config.go b/webapp/backend/pkg/config/config.go index 27e1c05..31243e9 100644 --- a/webapp/backend/pkg/config/config.go +++ b/webapp/backend/pkg/config/config.go @@ -6,6 +6,7 @@ import ( "github.com/spf13/viper" "log" "os" + "strings" ) // When initializing this class the following methods must be called: @@ -64,6 +65,11 @@ func (c *configuration) Init() error { //c.SetConfigName("drawbridge") //c.AddConfigPath("$HOME/") + //configure env variable parsing. + c.SetEnvPrefix("SCRUTINY") + c.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_")) + c.AutomaticEnv() + //CLI options will be added via the `Set()` function return nil }