From 61c88118474734f16f83443cad6588e8be3113a8 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 1 Oct 2014 11:58:27 -0700 Subject: [PATCH] updated docs for using custom driver --- README.md | 29 +++++++++++++++++++++++++++++ server/main.go | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index af94fd90e..b74b32221 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,27 @@ wget downloads.drone.io/exp/drone.deb sudo dpkg -i drone.deb ``` +## Database + +By default, Drone will create a SQLite database. Drone also supports Postgres and MySQL +databases. You can customize the database settings using the configuration options +described in the **Setup** section. + +Below are some example configurations that you can use as reference: + +``` +# to use postgres +[datasource] +driver="postgres" +source="host=172.17.0.2 user=postgres dbname=drone sslmode=disable" + +# to use mysql +[datasource] +driver="mysql" +source="root@tcp(172.17.0.2:3306)/drone" + +``` + ## Setup We are in the process of moving configuration out of the UI and into configuration @@ -33,6 +54,10 @@ The configuration file is in TOML format: ```toml +[datasource] +driver="" +source="" + [registration] open=true @@ -73,6 +98,10 @@ Or you can use environment variables ```sh +# custom database settings +export DRONE_DATASOURCE_DRIVER="" +export DRONE_DATASOURCE_SOURCE="" + # enable users to self-register export DRONE_REGISTRATION_OPEN=false diff --git a/server/main.go b/server/main.go index eb94c7295..b58a593b9 100644 --- a/server/main.go +++ b/server/main.go @@ -79,7 +79,7 @@ func main() { flag.StringVar(&prefix, "prefix", "DRONE_", "") flag.Parse() - config.StringVar(&datasource, "database-path", "drone.sqlite") + config.StringVar(&datasource, "database-source", "drone.sqlite") config.StringVar(&driver, "database-driver", "sqlite3") config.Var(&nodes, "worker-nodes") config.BoolVar(&open, "registration-open", false)