make sure we can pull config from env variables.
This commit is contained in:
@@ -24,6 +24,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
PROJECT_PATH: /go/src/github.com/analogj/scrutiny
|
PROJECT_PATH: /go/src/github.com/analogj/scrutiny
|
||||||
CGO_ENABLED: 1
|
CGO_ENABLED: 1
|
||||||
|
SCRUTINY_WEB_INFLUXDB_HOST: influxdb
|
||||||
steps:
|
steps:
|
||||||
- name: Git
|
- name: Git
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// When initializing this class the following methods must be called:
|
// When initializing this class the following methods must be called:
|
||||||
@@ -64,6 +65,11 @@ func (c *configuration) Init() error {
|
|||||||
//c.SetConfigName("drawbridge")
|
//c.SetConfigName("drawbridge")
|
||||||
//c.AddConfigPath("$HOME/")
|
//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
|
//CLI options will be added via the `Set()` function
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user