view edit attachments history changes search index home wikis login

geoffreyarnold.com


Monday 19. September 2005
CruiseControl Dashboard Widget

The CruiseControl Dashboard widget allows you to remotely monitor and manage builds on a CruiseControl instance via the server's built-in JMX support. Simply start CruiseControl with the -port argument and edit the widget's preferences to point to the server accordingly. Key features include:

  • Ability to force builds, as well as pause and resume builds.
  • Growl notifications of changes to build status.
  • View build results by clicking on a given project.

Dashboard.png

The main screen presents the status of the projects running on a given Cruise instance. Moving your mouse over a given project reveals a more detailed status message. The widget's user interface changes according to the health of the server.

Cruisin.png
The main widget screen.

Broken.png
Broken builds.

Fixed.png
All fixed.

Growl.png
Growl build status notifications.

The preferences screen allows you to configure various behaviors of the widget, such as the location of the CruiseControl server instance as well as the refresh interval of the widget.

Preferences.png
The preferences panel.

Contributions are welcome, so please feel free to email me any changes and I will merge them into the project.

Downloads:

Installation:

  1. Start CruiseControl, being sure to specify the -port argument, ie. $CC_BIN/cruisecontrol.sh -port 8000 -configfile ./config.xml
  2. Download and expand CruiseControl.wdgt-1.0.zip into your ~/Library/widgets directory.
  3. Switch to Dashboard and launch the widget. If this is the first time you have launched the widget (or you are upgrading from a previous release), the Preferences panel will be displayed upon startup. Fill out the required values and click "Save" to start the widget.

Change log:

  • 2005/09/18 - Release 1.0
    • Widget now uses JMX HTTP adapter to interact with CruiseControl server instead of RMI, resulting in increased performance and smaller footprint.
    • Added Growl notification support.
    • Added linking to build results.
    • Various user interface improvements.
  • 2005/06/03 - Release 0.3
    • Added support for monitoring multiple servers by launching additional widget instances (thanks to Bob Evans for his feedback).
    • General code cleanup.
  • 2005/05/28 - Release 0.2
    • Fixed UI updates when recovering from errors (thanks to Jeffrey Fredrick for his feedback).
    • Fixed concurrency issues when querying agent.
    • Modified agent to output status XML at every invocation to avoid cost of multiple calls.
    • Added logging to Java agent (~/Library/Logs/CruiseControlAgent.log).
    • Reorganized package namespace; general code cleanup.
  • 2005/05/20 - Initial release.
Last updated by 161.150.2.55 at 02:51:48 PM  |  Permalink

Tuesday 31. May 2005
Mac OS X 10.4 (Tiger) + RubyGems + Rails
I've become very interested in Ruby, primarily because of the promise of Rails. However don't let the advocates fool you: installing Rails into a non-standard location is anything but trivial due to complications with RubyGems. My environment is as follows:
  • Mac OS X 10.4 (Tiger)
  • Ruby 1.8.2 installed as part of standard Tiger installation in /usr
  • RubyGems 0.8.10 (from http://www.rubygems.org/) in ~/Public/ruby
The goal is to create a Rails application called "rails" under the directory ~/Development/ruby-workspace, requiring the installation of RubyGems in ~/Development/rubygems-0.8.10. Below you will find an annotated list of the steps I took to accomplish this goal (or you can view the terminal session here: RubyGems, Rails Install.txt).

NOTE: While I now have a working Ruby/RubyGems/Rails installation, the newly created Rails application still cannot connect to my local MySQL server.

The first step was to download and extract the latest RubyGems distribution (version 0.8.10 at the time of writing) and run the installer. The installation script was launched using the --prefix=/Users/garnold/Development/rubygems-0.8.10 option to specify an alternate installation directory, however the post-install.rb script failed complaining about a permissions problem in /usr/lib/ruby/gems/1.8:
Last login: Sun May 8 22:27:55 on ttyp4
Welcome to Darwin!
Geoffrey-Arnolds-Computer:~ garnold$ cd ~/Public/ruby
Geoffrey-Arnolds-Computer:~/Public/ruby garnold$ unzip -q rubygems-0.8.10.zip
Geoffrey-Arnolds-Computer:~/Public/ruby garnold$ cd rubygems-0.8.10
Geoffrey-Arnolds-Computer:~/Public/ruby/rubygems-0.8.10 garnold$ ruby setup.rb all --prefix=/Users/garnold/Development/rubygems-0.8.10
---> bin
<--- bin
---> lib
---> lib/rubygems
<--- lib/rubygems
<--- lib
---> bin
<--- bin
---> lib
---> lib/rubygems
<--- lib/rubygems
<--- lib
rm -f InstalledFiles
---> bin
mkdir -p /Users/garnold/Development/rubygems-0.8.10/bin/
install gem /Users/garnold/Development/rubygems-0.8.10/bin/
install gem_server /Users/garnold/Development/rubygems-0.8.10/bin/
install gemwhich /Users/garnold/Development/rubygems-0.8.10/bin/
install generate_yaml_index.rb /Users/garnold/Development/rubygems-0.8.10/bin/
install update_rubygems /Users/garnold/Development/rubygems-0.8.10/bin/
<--- bin
---> lib
mkdir -p /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/
install gemconfigure.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/
install rubygems.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/
install ubygems.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/
---> lib/rubygems
mkdir -p /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install builder.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install cmd_manager.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install command.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install config_file.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install custom_require.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install dependency_list.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install deployment.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install doc_manager.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install format.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install gem_commands.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install gem_runner.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install installer.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install loadpath_manager.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install old_format.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install open-uri.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install package.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install remote_installer.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install rubygems_version.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install source_index.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install specification.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install timer.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install user_interaction.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install validator.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
install version.rb /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems
<--- lib/rubygems
<--- lib

As of RubyGems 0.8.0, library stubs are no longer needed.
Searching $LOAD_PATH for stubs to optionally delete (may take a while)...
...done.
No library stubs found.

Successfully built RubyGem
Name: sources
Version: 0.0.1
File: sources-0.0.1.gem
hook /Users/garnold/Public/ruby/rubygems-0.8.10/./post-install.rb failed:
You don't have write permissions into the /usr/lib/ruby/gems/1.8 directory.
Try 'ruby setup.rb --help' for detailed usage.

It seems that no matter what directory you specify with the --prefix option, RubyGems insists on installing files under /usr. This is troubling, but let's test the installation anyway:
Geoffrey-Arnolds-Computer:~/Public/ruby/rubygems-0.8.10 garnold$ cd ~/Development/rubygems-0.8.10
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ ./bin/gem install rails --install-dir=/Users/garnold/Development/rubygems-0.8.10/lib/ruby/gems./bin/gem:3:in `require': No such file to load -- rubygems (LoadError)
from ./bin/gem:3

Looks like Ruby cannot find the RubyGems libraries. The Ruby man page tells us to use the RUBYLIB environment variable to point Ruby to its extensions:
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ export RUBYLIB=/Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8:/Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ ./bin/gem install rails --install-dir=/Users/garnold/Development/rubygems-0.8.10/lib/ruby/gemsAttempting local installation of 'rails'
Local gem file not found: rails*.gem
Attempting remote installation of 'rails'
/Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems.rb:194:in `report_activate_error': Could not find RubyGem sources (> 0.0.0) (Gem::LoadError)
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems.rb:136:in `activate'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems.rb:37:in `require_gem_with_options'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems.rb:31:in `require_gem'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:403:in `sources'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:413:in `source_index_hash'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:377:in `install'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:179:in `execute'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:137:in `each'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:137:in `execute'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems/command.rb:49:in `invoke'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:92:in `process_args'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:65:in `run'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:9:in `run'
from ./bin/gem:17

Now RubyGems is complaining about now being about to find the sources package (most likely something that would have been installed by the post-install.rb script). Therefore we must manually install the package from the gem included with the RubyGems distribution:
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ ./bin/gem install ~/Public/ruby/rubygems-0.8.10/pkgs/sources/sources-0.0.1.gem --install-dir=/Users/garnold/Development/rubygems-0.8.10/lib/ruby/gems
Attempting local installation of '/Users/garnold/Public/ruby/rubygems-0.8.10/pkgs/sources/sources-0.0.1.gem'
Successfully installed sources, version 0.0.1

Another attempt at installing Rails leads us back to the permissions problem, so we (begrudgingly) create the required directories:
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ ./bin/gem install rails --install-dir=/Users/garnold/Development/rubygems-0.8.10/lib/ruby/gemsAttempting local installation of 'rails'
Local gem file not found: rails*.gem
Attempting remote installation of 'rails'
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/lib/ruby/gems
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ sudo mkdir /usr/lib/ruby/gems
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ ./bin/gem install rails --install-dir=/Users/garnold/Development/rubygems-0.8.10/lib/ruby/gems
Attempting local installation of 'rails'
Local gem file not found: rails*.gem
Attempting remote installation of 'rails'
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/lib/ruby/gems/1.8
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ sudo mkdir /usr/lib/ruby/gems/1.8

Finally Rails can be installed:
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ ./bin/gem install rails --install-dir=/Users/garnold/Development/rubygems-0.8.10/lib/ruby/gems
Attempting local installation of 'rails'
Local gem file not found: rails*.gem
Attempting remote installation of 'rails'
Install required dependency rake? [Yn]
Install required dependency activesupport? [Yn]
Install required dependency activerecord? [Yn]
Install required dependency actionpack? [Yn]
Install required dependency actionmailer? [Yn]
Install required dependency actionwebservice? [Yn]
Successfully installed rails-0.12.1
Successfully installed rake-0.5.4
Successfully installed activesupport-1.0.4
Successfully installed activerecord-1.10.1
Successfully installed actionpack-1.8.1
Successfully installed actionmailer-0.9.1
Successfully installed actionwebservice-0.7.1
Installing RDoc documentation for rake-0.5.4...
Installing RDoc documentation for activesupport-1.0.4...
Installing RDoc documentation for activerecord-1.10.1...
Installing RDoc documentation for actionpack-1.8.1...
Installing RDoc documentation for actionmailer-0.9.1...
Installing RDoc documentation for actionwebservice-0.7.1...

Now we attempt to create our sample application called "rails":
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ ./lib/ruby/gems/bin/rails /Users/garnold/Development/ruby-workspace/rails
/Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems.rb:194:in `report_activate_error': Could not find RubyGem rails (> 0) (Gem::LoadError)
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems.rb:136:in `activate'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems.rb:37:in `require_gem_with_options'
from /Users/garnold/Development/rubygems-0.8.10/lib/ruby/site_ruby/1.8/rubygems.rb:31:in `require_gem'
from ./lib/ruby/gems/bin/rails:17

The RubyGems manual instructs us to use the GEM_PATH environment variable to specify the location of installed gems. With this variable set the application can be created:
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ export GEM_PATH=/Users/garnold/Development/rubygems-0.8.10/lib/ruby/gems
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ ./lib/ruby/gems/bin/rails /Users/garnold/Development/ruby-workspace/rails
create
create app/apis
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create components
create db
create doc
create lib
create log
create public/images
create public/javascripts
create public/stylesheets
create script
create test/fixtures
create test/functional
create test/mocks/development
create test/mocks/test
create test/unit
create vendor
create Rakefile
create README
create CHANGELOG
create app/controllers/application.rb
create app/helpers/application_helper.rb
create test/test_helper.rb
create config/database.yml
create config/routes.rb
create public/.htaccess
create config/environment.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/console
create script/console_sandbox
create script/destroy
create script/generate
create script/server
create script/runner
create script/benchmarker
create script/profiler
create script/breakpointer
create public/dispatch.rb
create public/dispatch.cgi
create public/dispatch.fcgi
create public/404.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/javascripts/prototype.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
Geoffrey-Arnolds-Computer:~/Development/rubygems-0.8.10 garnold$ cd ~/Development/ruby-workspace/rails
Geoffrey-Arnolds-Computer:~/Development/ruby-workspace/rails garnold$ ruby script/generate controller sample
exists app/controllers/
exists app/helpers/
create app/views/sample
exists test/functional/
create app/controllers/sample_controller.rb
create test/functional/sample_controller_test.rb
create app/helpers/sample_helper.rb
Geoffrey-Arnolds-Computer:~/Development/ruby-workspace/rails garnold$ ruby script/server
=> Rails application started on http://0.0.0.0:3000
[2005-05-08 22:42:26] INFO WEBrick 1.3.1
[2005-05-08 22:42:26] INFO ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]
[2005-05-08 22:42:26] INFO WEBrick::HTTPServer#start: pid=1390 port=3000
127.0.0.1 - - [08/May/2005:22:43:09 EDT] "GET /sample HTTP/1.1" 200 13
- -> /sample
Last updated by 161.150.2.55 at 09:02:47 AM  |  Permalink

Sunday 3. April 2005
Importing Mailboxes into Apple Mail.app
Here's a quick tip for something that cost me a lot of time. Being a recent switcher, I wanted to import my existing email from Mozilla Mail into Apple Mail. Despite the fact that the Mail import feature completed without error, many of my messages were missing due to the mailbox files containg different line endings (an artifact of numerous transfers between Mozilla Mail running on Linux and Windows). A Google search revealed a number of methods to convert line endings, however I had the most success with the method listed at the bottom of this Mac OSX Hints post. Here is the shell script:
#!/bin/sh
#
# USAGE: fixascii.sh [files or directories to convert]
# http://www.macosxhints.com/article.php?story=20031018164326986
#
zip -qr foo.zip "$@" && unzip -aqo foo.zip && rm foo.zip
Last updated by 69.173.197.84 at 02:07:00 PM  |  Permalink
Search

December 2008
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Personal

RSS