Copyright © 2010 Red Hat, Inc.
Written by Mohammed Morsi <[email protected]>
Polisher is a project release management tool which can be used to register various event handlers to be invoked on specific versions of project / source releases. Polisher provides a simple REST interface which to create projects w/ sources and dependencies, and to download and transform them into any target output format.
Polisher also provides a simple DSL frontend to the REST interface, able to be used to create and trigger elegant release workflows for any number of projects simultaneously. Workflows for many major Ruby based projects have been setup, transforming various versions into Fedora repos and can be found at [github.com/movitto/polisher-scripts].
To install simply run:
'gem install polisher'
Alternatively checkout the source from github via
‘git clone git://github.com/movitto/polisher.git’
Polisher requires various rubygems to work. gem install should pull in all dependencies but if running polisher from source, be sure to gem install:
-
rubygems
-
sinatra
-
libxml
-
curb
-
activerecord
-
libxml
For the complete list of dependencies, see the Rakefile.
Polisher currently pulls config from the config/ subdir, the database params are defined in database.yml (currently defaulting to a sqlite flat file db residing in db/data), and the general application config resides in polisher.yml. The only general app config currently used is ‘gem_api_key’, which will be read from ~/.gem/credentials if missing from polisher.yml.
To run the server, run ‘./bin/server’ in the project root.
To run the spec suite simply run ‘rake spec’
Config is environment specific, the server runs in the ‘development’ environment by default and the spec suite runs in ‘test’ by default. To change the environment simply run
'export RACK_ENV="production"'
before ‘./bin/server’ or ‘rake spec’, etc
Run ‘rake spec’ in the project root to generate the API docs in the doc/ subdir. Also see the spec suite and polisher scripts for more detailed usage.
When running, the server can be accessed by navigating to ‘localhost:3000’. REST requests may be issued against that URI and the actions defined in polisher.rb. The DSL sits on top of this REST interface and provides a nice / simple means which to setup projects, sources, release workflows, etc, in an easily reproducable manner.
At typical DSL use case might look like:
project :name => "ruby" do |proj| proj.add_archive :name => 'ruby_source', :uri => "ftp://ftp.ruby-lang.org/pub/ruby/%{rubyxver}/ruby-%{arcver}.tar.bz2" do |archive| archive.version "1.8.6", :rubyxver => "1.8", :arcver => "1.8.7-p311", :corresponds_to => proj.version("1.8.6") proj.version "1.9.1", :corresponds_to => archive.version("1.9.1", :rubyxver => "1.9", :arcver => "1.8.7-p300") end proj.add_patch "http://cvs.fedoraproject.org/viewvc/rpms/ruby/F-13/ruby-deadcode.patch?view=markup" # etc... proj.on_version "*", "create package" proj.on_version "=", "1.8.6", "update repo", "stable" proj.on_version ">=", "1.9.1", "update repo", "devel" end
Polisher is a work in progress, and features are being added / removed as neccessary. Comments, bug reports, and patches are all very welcome.
Out of the box Polisher is able to handle Rubygem based projects and generate rpm packages and yum repos on project releases. The Gemcutter API, gem2rpm, and rpm / yum tools are used to accomplish this, though Polisher can be easily extended to support any input / output format.
The code itself currently has to be modified (most likely will be changed in the future), but to add support for downloading another input source format, extend source.rb::download_to and optionally add another add_source_type method to the Polisher::Project DSL.
To add another event handler, simple add a new method to the EventHandlers module. Polisher will take care of the rest.