mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-30 08:06:52 +02:00
Merge pull request #1120 from donny-dont/features/remove-toml-config
Removing toml config
This commit is contained in:
commit
5a3fa1a047
@ -34,14 +34,13 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
conf = flag.String("config", "drone.toml", "")
|
||||
debug = flag.Bool("debug", false, "")
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
settings, err := config.Load(*conf)
|
||||
settings, err := config.Load()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -55,6 +54,7 @@ func main() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
session := session.New(settings)
|
||||
eventbus_ := eventbus.New()
|
||||
queue_ := queue.New()
|
||||
|
@ -93,20 +93,10 @@ type Config struct {
|
||||
}
|
||||
}
|
||||
|
||||
// Load loads the configuration file and reads
|
||||
// parameters from environment variables.
|
||||
func Load(path string) (*Config, error) {
|
||||
return LoadBytes([]byte{})
|
||||
}
|
||||
|
||||
// LoadBytes reads the configuration file and
|
||||
// reads parameters from environment variables.
|
||||
func LoadBytes(data []byte) (*Config, error) {
|
||||
// Load loads the configuration from environment
|
||||
// variables.
|
||||
func Load() (*Config, error) {
|
||||
conf := &Config{}
|
||||
// err := toml.Unmarshal(data, conf)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
err := envconfig.Init(conf)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user