Jeff Dean's blog
AutoTagger is a gem that helps you automatically create a date-stamped tag for each stage of your deployment, and deploy from the last tag from the previous environment.
Let's say you have the following workflow:
- Run all test on a Continuous Integration (CI) server
- Deploy to a staging server
- Deploy to a production server
You can use the autotag command to tag releases on your CI box, then use the capistrano tasks to auto-tag each release.
We use Cruise Control on our Continuous Integration server and we have several ways of getting alerts about the status of the build, including email, RSS and the Cruise Control web interface.
Recently we noticed that the web interface and the rss feeds were taking very long to respond, on the order of 1 minute or more. After poking around, we realized that we had hundreds of serialized builds still on disk.
$ cd ~/OurCruiseDirectory/projects/OurProject
$ rm -r build-*
Then, to make sure this doesn't happen again, we edited our OurCruiseDirectory/site_config.rb site_config.rb to decrease the number of builds we keep:
BuildReaper.number_of_builds_to_keep = 20
So it appears that the time Cruise Control responses take is directly proportional to the number of builds saved on the server.
Interesting
While this has been mentioned before, naming an ActiveRecord association :target will cause infinite recursion. Especially lame if you are building an app for assassins or mobsters.
The tracker team upgraded to 2.2 and saw a big increase in the size of their mongrels, and much longer start-up times.
In an erector widget it appears that respond_to? checks arity. For example:
self.respond_to?("some_method") # => false
self.respond_to?("some_method", some_value) # => true
Moving from Subversion to Git
We recently moved our project from subversion to git, and so far the move has gone very smoothly. The following post will detail what we did to make the move.
Our setup
For this project there 2 pairs working and we have 6 machines and one hosted service:
- Two Mac OSX workstations with IDEA
- One continuous integration server running Cruise Control
- A staging server running a 2-year old version of Ubuntu
- A subversion server
- A production server hosted on Engine Yard
- A Github account with the ability to create private repositories
The goal was to have one pair continue to work while the migration from svn to git was happening.
Helps
What is capistrano multistage?
- A plugin that allows you to store environment-specific variables in different files, and specify a default environment
- It's been on tracker for a while and seems to be stable
- Other options are just specifying your environment-specific variables within separate tasks - keeping everything in one file
Interesting Things
When you specify a gem from a custom source, and it has dependencies on a separate source, you need to list both sources in geminstaller.yml.
This comes up when you are installing a gem from github and that gem depends on other gems from rubyforge. You can specify multiple sources by adding more --source attributes.
Interesting Things
When using standard rails partials you always have a local variable named _counter. In previous versions of rails, the partial_counter variable was set to 0 when you passed an object, and set to 1 for the first item in a collection. Now it appears to start at 0 whether you pass an object or a collection.
Brian Takita has begun work on chaining doubles in RR
