[Cruisecontrolrb-users] CruiseControl.rb and Database settings

48 views
Skip to first unread message

Matthew O'Riordan

unread,
Oct 15, 2010, 12:41:39 PM10/15/10
to cruisecont...@rubyforge.org
Hi all

I have set up CruiseControl.rb on an Ubuntu box, and all seems to be working quite well at present.  However, I am not sure how best to approach the issue of using database settings specific to the CC server and not storing these anywhere in the source control repository.  I read an article at http://blog.lrdesign.com/2010/02/howto-setting-up-cruisecontrol-rb-on-slicehost/ which suggest you make the following change to the cruise_config.rb file:
project.build_command = 'rake ci:run[localhost,root,<YOUR_MYSQL_ROOT_PASSWORD>,<DATABASE_NAME>] --trace RAILS_ENV=test'

The problem I have with that is that in order to get CC working with Bundler I've created a build_my_app.sh shell script and have that referenced in the build command.  In that file I have something along the lines of 
bundle install
ruby -e "require 'rubygems' rescue nil; require 'rake'; load '/Users/matt/cruisecontrol/tasks/cc_build.rake'; ARGV << '--nosearch' << 'cc:build'; Rake.application.run; ARGV.clear" 

So where and how do I inject database settings specific for this CC server?

Sorry if I am asking stupid questions, but I'm only one day into using CruiseControl.rb.

Thanks,

Matthew O'Riordan

Todd Sedano

unread,
Oct 15, 2010, 1:09:33 PM10/15/10
to cruisecont...@rubyforge.org
I'm also a cruisecontrol novice, but this is how I solve the problem. 

I don't check the config/database.yml file into source control. I create a .gitignore or .svnignore so that it doesn't accidentally end up in the repository.

After I create the project on the build machine, I go to the .cruise/projects/NAME/work directory and create my own config/database.yml file 

This works provided that no one checks in a config/database.yml file

I'm hoping one of the advance users will tell of a better way =)

Thanks,

Todd

Alexey Verkhovsky

unread,
Oct 15, 2010, 1:32:09 PM10/15/10
to cruisecont...@rubyforge.org
On Fri, Oct 15, 2010 at 11:09 AM, Todd Sedano <todd....@sv.cmu.edu> wrote:
I don't check the config/database.yml file into source control. I create a .gitignore or .svnignore so that it doesn't accidentally end up in the repository.

After I create the project on the build machine, I go to the .cruise/projects/NAME/work directory and create my own config/database.yml file 

i'm a big fan of simple soltions that work, so that's exactly how I like to do it. On the premise that not every developer's box should contain access details to all of our umpteen production databases, anyway. Therefore, source-control config/database.yml.example and have it symlinked as database.yml on development machines. Symlink to a local file like /etc/myapplication/database.yml on prod and ci servers. Problem solved.

--
Alexey Verkhovsky
http://alex-verkhovsky.blogspot.com/
CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com]

Reply all
Reply to author
Forward
0 new messages