DevTower Beta3! (0.3)
I’m proud to announce some major changes and improvements to DevTower in
this beta release! First and foremost, DevTower is now a full plugin.
Also,
DevTower works (only) with Rails 1.1.
==== ABOUT =====
DevTower used to synchronize the development of Ruby On
Rails applications with developers working simultaniously
on multiple systems with Subversion. DevTower is built
around the philosophy of responsible group-development
and enforces certain development practices which you may
or may not like. However, it is my belief that all are good
practices for any collaborative development system.
It is comprised of a few extensions to ActiveRecord::Base
(via a modified ar_fixtures) and several Rake tasks to speed
group development.
This was one of those things that was made for use in-house.
Many of you probably have scripts around that do similar things
to synchronize your development (especially databases are tricky).
I just happen to be making this one public.
STABILITY: This software is in development… so don’t use it
on huge projects with only one copy in existance. Aka, don’t
be stupid. However, for a new project, you can feel fairly secure
in its functionality.
==== INSTALLATION ======
To get the new plugin download from
http://rubyforge.org/frs/?group_id=1438&release_id=4838
Unzip so that… RAILS_PATH/vendor/plugins/devtower/
===== USE ======
A developer will run ‘rake commit’ and DevTower will write the database
schema and data to file and clear out all the logs and then run ‘svn
ci’.
Then, the next developer, to synchronize, will run ‘rake checkout’ and
it
will update his working directory and load up the new schema and new
data fresh from the development server.
===== DOCUMENTATION ======
DevTower gives you the following commands:
rake db:hold:dump
-writes the current database down to yaml files in
RAILS_APP/db/hold/*.yml Think of this as your data-dump to file.
rake db:hold:load
-loads the yaml model files from db/hold/*.yml into the current
database. CHECK /db/hold BEFORE YOU DO THIS, because it will dump your
current db and load it. So, just make sure that the yaml files have
something in them.
rake commit:prepare
-dumps the database down to the hold
-dumps the schema to schema.rb
-clears the /tmp folder
-clears the /log files
rake commit:force
-simply runs ‘svn ci -m “#{diff of CHANGELOG}”’
-uses whatever has been added to RAILS_APP/CHANGELOG since the last
commit as the commit message.
rake commit
-runs commit:prepare
-runs test … your tests should pass before you commit anything
ever!
-runs commit:force to do the actual commit
-uses whatever has been added to RAILS_APP/CHANGELOG since the last
commit as the commit message.
rake commit:skip_tests
-if your a bad-boy and don’t have working tests, then prepare and
commit
anyway
rake checkout:after
-WIPES current db
-reads in schema from /db/schema.rb
-reads in data from /db/hold/*.yml
rake checkout
-performs ‘svn up’
-yes, i know its an update and not a checkout
-runs checkout:after to do everything needed to start coding!
==== NOTES =====
Here are a few things that DevTower is NOT:
- IT IS NOT a deployment system like Capistrano.
- IT IS NOT the solution for everyone.
- IT IS NOT built to work with CVS.
- IT IS NOT completely stable.
All of those things being said. Here is what it does do.
- Works with SVN.
- Forces tests to pass before committing to the repository.
- Writes database schema and data to /db/hold/*.yml before committing.
- Reads them back after checkout.
===== BIG QUESTION =====
What about migrations?
migrations are great when you are working with a stable/production
database
and have muiltiple branches. but, we use schema.rb to keep things in
line early in
development before branching and before stability… really good for
when the database is
changingoften and radically. migrations are great for small
changes,
painful for large
ones very often.
Its not working right!
That’s not a question. Stop yelling and go to
http://rubyforge.org/projects/devtower/
and file a bug report.
It destroyed my precious, high-risk data! Why?
I told you not to do it. Only use development data in the holds.
Does it work on windows?
I don’t see why not. I didn’t test it. In fact, I only tested it on
Ubuntu Dapper.
Does it work with Rails 1.0?
No.
======
Special thanks to Geoffrey Grosenbach for his ar_fixtures plugin.
-hampton catlin.