Soprano is the set of Capistrano recipes that help me to deploy my applications.
Soprano by default uses Mongrel cluster (or Passenger) as an application server, nginx as a web server, MySQL as a database server and git as a SCM.
The latest version of Soprano was inspired by Rubaidh's Rubaidhstrano and some code has been borrowed from its sources.
For Rails 3 add to your
gem 'soprano', :require => false
To start using Soprano you just need to add
require "soprano" to your
config/deploy.rb file and set some variables:
require "soprano" set :application, "set your application name here" set :repository, "set your repository location here" set :host, "set your host here" # See soprano/recipes/defaults.rb for defaults
Sometimes we need to execute an arbitrary command or script on our
server within the application. To aid with thin, Soprano offers a bunch
remote scripts. For example:
$ cap remote:command -s cmd="ls -l" you'll even get the output here...
Similar tasks exist for rake, thor and runner. Try
cap -T remote. Note:
runner does not put to the STDOUT anything.
$ cap remote:rake -s cmd="db:drop" && echo "What have I done!" $ cap remote:thor -s cmd="thor:task" $ cap remote:runner -s cmd="1000**1000 while true" && echo "Computers should compute"
Don't forget to use
-s option. Also wrap
cmd= argument in quotes.
Yeah, this is not comfortable, but it's intentional. Consider it a
syntax vinegar. If you have a repeated task, write a Capistrano recipe
for it. This remote calls are for really occasional tasks.
You also have
cap remote:tail to tail the application log.
If all you need is just remotely run the rake tasks, you may also want to consider using Cape.
Readme about other features in process...
Copyright (c) 2011 Dmitriy Kiriyenko. See LICENSE for details.