From 001e6c9f5f87d66bc81978ccc8f23a004c1644e9 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Mon, 3 Aug 2015 22:46:58 -0700 Subject: [PATCH] fixed incorrect docs, removed toml depdendency --- doc/setup/mysql.md | 4 ++-- doc/setup/postgres.md | 4 ++-- doc/setup/sqlite.md | 6 +++--- pkg/config/config.go | 8 +------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/doc/setup/mysql.md b/doc/setup/mysql.md index 2cd2109a9..380cf76f7 100644 --- a/doc/setup/mysql.md +++ b/doc/setup/mysql.md @@ -5,8 +5,8 @@ Drone comes with support for MySQL as an alternate database engine. To enable Postgres, you should specify the following environment variables: ``` -DATASTORE_DRIVER="mysql" -DATASTORE_CONFIG="root:pa55word@tcp(localhost:3306)/drone" +DATABASE_DRIVER="mysql" +DATABASE_DATASOURCE="root:pa55word@tcp(localhost:3306)/drone" ``` ## MySQL connection diff --git a/doc/setup/postgres.md b/doc/setup/postgres.md index 24af892c9..fb4ddcaf6 100644 --- a/doc/setup/postgres.md +++ b/doc/setup/postgres.md @@ -4,8 +4,8 @@ Drone comes with support for Postgres as an alternate database engine. To enable Postgres, you should specify the following environment variables: ``` -DATASTORE_DRIVER="postgres" -DATASTORE_CONFIG="postgres://root:pa55word@127.0.0.1:5432/postgres" +DATABASE_DRIVER="postgres" +DATABASE_DATASOURCE="postgres://root:pa55word@127.0.0.1:5432/postgres" ``` ## Postgres connection diff --git a/doc/setup/sqlite.md b/doc/setup/sqlite.md index 31fadf637..473541c3f 100644 --- a/doc/setup/sqlite.md +++ b/doc/setup/sqlite.md @@ -3,13 +3,13 @@ Drone uses SQLite as the default database with zero configuration required. In order to customize the SQLite database configuration you should specify the following environment variables: ``` -DATASTORE_DRIVER="sqlite3" -DATASTORE_CONFIG="/var/lib/drone/drone.sqlite" +DATABASE_DRIVER="sqlite3" +DATABASE_DATASOURCE="/var/lib/drone/drone.sqlite" ``` ## Sqlite3 connection -The components of this connection string are: +The components of the datasource connection string are: * `path` local path to sqlite database. The default value is `/var/lib/drone/drone.sqlite`. diff --git a/pkg/config/config.go b/pkg/config/config.go index 0dcd610b1..fbe55ca6e 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" ) @@ -98,11 +96,7 @@ 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) + return LoadBytes([]byte{}) } // LoadBytes reads the configuration file and