diff --git a/cmd/drone-server/drone.go b/cmd/drone-server/drone.go index 159e80de7..e0893e2ce 100644 --- a/cmd/drone-server/drone.go +++ b/cmd/drone-server/drone.go @@ -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() diff --git a/pkg/config/config.go b/pkg/config/config.go index 0dcd610b1..4a89b11e5 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -2,13 +2,11 @@ package config import ( "fmt" - "io/ioutil" "os" "path" "strings" log "github.com/drone/drone/Godeps/_workspace/src/github.com/Sirupsen/logrus" - // "github.com/drone/drone/Godeps/_workspace/src/github.com/naoina/toml" "github.com/drone/drone/Godeps/_workspace/src/github.com/vrischmann/envconfig" ) @@ -95,24 +93,10 @@ type Config struct { } } -// Load loads the configuration file and reads -// parameters from environment variables. -func Load(path string) (*Config, error) { - data, err := ioutil.ReadFile(path) - if err != nil { - return nil, err - } - return LoadBytes(data) -} - -// 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