make sure we can pull config from env variables.

pull/228/head
Jason Kulatunga 3 years ago
parent 7cd828ef0d
commit 00bc6ecd92

@ -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: |

@ -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
}

Loading…
Cancel
Save