From 1951aeac78974d38ffa5528feb4b97ef6d458377 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 18 Jan 2014 23:59:32 +0000 Subject: add .travis.yml and switch database user/password by environments git-svn-id: http://svn.redmine.org/redmine/trunk@12665 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/tasks/ci.rake | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 945836162..fbc4d5688 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -54,13 +54,23 @@ file 'config/database.yml' do when 'mysql' dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'), 'database' => dev_db_name, 'host' => 'localhost', - 'username' => 'jenkins', 'password' => 'jenkins', 'encoding' => 'utf8'} + if ENV['RUN_ON_NOT_OFFICIAL'] + dev_conf['username'] = 'root' + else + dev_conf['username'] = 'jenkins' + dev_conf['password'] = 'jenkins' + end test_conf = dev_conf.merge('database' => test_db_name) when 'postgresql' dev_conf = {'adapter' => 'postgresql', 'database' => dev_db_name, - 'host' => 'localhost', - 'username' => 'jenkins', 'password' => 'jenkins'} + 'host' => 'localhost'} + if ENV['RUN_ON_NOT_OFFICIAL'] + dev_conf['username'] = 'postgres' + else + dev_conf['username'] = 'jenkins' + dev_conf['password'] = 'jenkins' + end test_conf = dev_conf.merge('database' => test_db_name) when /sqlite3/ dev_conf = {'adapter' => (Object.const_defined?(:JRUBY_VERSION) ? -- cgit v1.2.3