mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-05 08:58:29 +00:00
Get configs from environment variables
This commit is contained in:
6
main.go
6
main.go
@@ -17,12 +17,18 @@ package main
|
||||
import (
|
||||
"github.com/runatlantis/atlantis/cmd"
|
||||
"github.com/spf13/viper"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const atlantisVersion = "0.3.3"
|
||||
|
||||
func main() {
|
||||
v := viper.New()
|
||||
// Get environment variables with ATLANTIS prefix
|
||||
v.SetEnvPrefix("ATLANTIS")
|
||||
replacer := strings.NewReplacer("-","_")
|
||||
v.SetEnvKeyReplacer(replacer)
|
||||
v.AutomaticEnv()
|
||||
|
||||
// We're creating commands manually here rather than using init() functions
|
||||
// (as recommended by cobra) because it makes testing easier.
|
||||
|
||||
Reference in New Issue
Block a user