# This defines a deployment "recipe" that you can feed to capistrano # (http://manuals.rubyonrails.com/read/book/17). It allows you to automate # (among other things) the deployment of your application. # ============================================================================= # REQUIRED VARIABLES # ============================================================================= # You must always specify the application and repository for every recipe. The # repository must be the URL of the repository you want this recipe to # correspond to. The deploy_to path must be the path on each machine that will # form the root of the application path. set :application, "xlsuite" set :repository, "svn://svn.teksol.info/repos/rac/xlsuite.org/branches/stable" # ============================================================================= # ROLES # ============================================================================= # You can define any number of roles, each of which contains any number of # machines. Roles might include such things as :web, or :app, or :db, defining # what the purpose of each machine is. You can also specify options that can # be used to single out a specific subset of boxes in a particular role, like # :primary => true. role :web, "xlsuite.dev.teksol.info" role :app, "xlsuite.dev.teksol.info" role :db, "xlsuite.dev.teksol.info", :primary => true # ============================================================================= # OPTIONAL VARIABLES # ============================================================================= set :deploy_to, "/usr/local/www/xlsuite.org" # defaults to "/u/apps/#{application}" set :user, "xlsuite" # defaults to the currently logged in user # set :scm, :darcs # defaults to :subversion # set :svn, "/path/to/svn" # defaults to searching the PATH # set :darcs, "/path/to/darcs" # defaults to searching the PATH # set :cvs, "/path/to/cvs" # defaults to searching the PATH # set :gateway, "gate.host.com" # default to no gateway set :use_sudo, false # ============================================================================= # SSH OPTIONS # ============================================================================= # ssh_options[:keys] = %w(/path/to/my/key /path/to/another/key) # ssh_options[:port] = 22 # ============================================================================= # TASKS # ============================================================================= # Define tasks that run on all (or only some) of the machines. You can specify # a role (or set of roles) that each task should be executed on. You can also # narrow the set of servers to a subset of a role by specifying options, which # must match the options given for the servers to select (like :primary => true) task :after_update_code do run < :app do run "tail -f #{shared_path}/log/production.log" do |channel, stream, data| puts # for an extra line break before the host name puts "#{channel[:host]}: #{data}" break if stream == :err end end desc "remotely console" task :console, :roles => :app do input = '' run "cd #{current_path} && ./script/console #{ENV['RAILS_ENV']}" do |channel, stream, data| next if data.chomp == input.chomp || data.chomp == '' print data channel.send_data(input = $stdin.gets) if data =~ /^(>|\?)>/ end end