fixed incorrect docs, removed toml depdendency

This commit is contained in:
Brad Rydzewski 2015-08-03 22:46:58 -07:00
parent 4270573536
commit 001e6c9f5f
4 changed files with 8 additions and 14 deletions

View File

@ -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: Drone comes with support for MySQL as an alternate database engine. To enable Postgres, you should specify the following environment variables:
``` ```
DATASTORE_DRIVER="mysql" DATABASE_DRIVER="mysql"
DATASTORE_CONFIG="root:pa55word@tcp(localhost:3306)/drone" DATABASE_DATASOURCE="root:pa55word@tcp(localhost:3306)/drone"
``` ```
## MySQL connection ## MySQL connection

View File

@ -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: Drone comes with support for Postgres as an alternate database engine. To enable Postgres, you should specify the following environment variables:
``` ```
DATASTORE_DRIVER="postgres" DATABASE_DRIVER="postgres"
DATASTORE_CONFIG="postgres://root:pa55word@127.0.0.1:5432/postgres" DATABASE_DATASOURCE="postgres://root:pa55word@127.0.0.1:5432/postgres"
``` ```
## Postgres connection ## Postgres connection

View File

@ -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: 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" DATABASE_DRIVER="sqlite3"
DATASTORE_CONFIG="/var/lib/drone/drone.sqlite" DATABASE_DATASOURCE="/var/lib/drone/drone.sqlite"
``` ```
## Sqlite3 connection ## 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`. * `path` local path to sqlite database. The default value is `/var/lib/drone/drone.sqlite`.

View File

@ -2,13 +2,11 @@ package config
import ( import (
"fmt" "fmt"
"io/ioutil"
"os" "os"
"path" "path"
"strings" "strings"
log "github.com/drone/drone/Godeps/_workspace/src/github.com/Sirupsen/logrus" 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" "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 // Load loads the configuration file and reads
// parameters from environment variables. // parameters from environment variables.
func Load(path string) (*Config, error) { func Load(path string) (*Config, error) {
data, err := ioutil.ReadFile(path) return LoadBytes([]byte{})
if err != nil {
return nil, err
}
return LoadBytes(data)
} }
// LoadBytes reads the configuration file and // LoadBytes reads the configuration file and