Module: OxenDeployer

Defined in:
lib/oxen_deployer.rb

Overview

Deployer - Pragmatic application deployment automation, without mercy.

Please read doco/getting_started.txt or rubyhitsquad.com/

Basic scenario:

  1. rake deployer:setup (first time only)

  2. rake deployer:update

  3. rake deployer:migrate (optional)

  4. rake deployer:start

Defined Under Namespace

Classes: Subversion

Constant Summary collapse

VERSION =

This is the version of Deployer you are running.

"1.0.0"

Class Method Summary collapse

Class Method Details

.load(options = {}) ⇒ Object

Loads tasks file tasks_file and various recipe styles as a hash of category/style pairs. Recipes default to:

:app    => :passenger
:config => 'config/deploy.rb'
:core   => :core
:scm    => :subversion
:web    => :apache

You can override individual values and/or set to nil to deactivate. :config will get loaded last to ensure that user variables override default values.

And by all means, feel free to skip this entirely if it doesn’t fit for you. All it does is a fancy-pants require. Require whatever files you need as you see fit straight from your Rakefile. YAY for simple and clean!



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/oxen_deployer.rb', line 45

def self.load options = {}
  options = {:config => options} if String === options
  order = [:core, :type, :app, :config, :scm, :web]
  order += options.keys - order

  recipes = {
    :app    => :passenger,
    :type   => :rails,
    :config => 'config/deploy.rb',
    :core   => :core,
    :scm    => :subversion,
    :web    => :apache,
  }.merge(options)

  order.each do |flavor|
    recipe = recipes[flavor]
    next if recipe.nil? or flavor == :config
    begin
      require "oxen_deployer/#{recipe}"
    rescue LoadError => e
      re = RuntimeError.new e.message
      re.backtrace = e.backtrace
      raise re
    end
  end

  set :skip_scm, false

  Kernel.load recipes[:config]
  Kernel.load "#{File.dirname(recipes[:config])}/deploy_#{ENV['to']}.rb" if ENV['to']
end