module Ferry::DSL

Public Instance Methods

invoke(task, *args) click to toggle source
# File lib/ferry/dsl.rb, line 15
def invoke(task, *args)
  Rake::Task[task].invoke(*args)
end
local_user() click to toggle source
# File lib/ferry/dsl.rb, line 45
def local_user
  fetch(:local_user)
end
lock(locked_version) click to toggle source
# File lib/ferry/dsl.rb, line 49
def lock(locked_version)
  VersionValidator.new(locked_version).verify
end
on(hosts, options={}, &block) click to toggle source
# File lib/ferry/dsl.rb, line 53
def on(hosts, options={}, &block)
  subset_copy = Marshal.dump(Configuration.env.filter(hosts))
  SSHKit::Coordinator.new(Marshal.load(subset_copy)).each(options, &block)
end
revision_log_message() click to toggle source
# File lib/ferry/dsl.rb, line 31
def revision_log_message
  fetch(:revision_log_message,
    t(:revision_log_message,
      branch: fetch(:branch),
      user: local_user,
      sha: fetch(:current_revision),
      release: fetch(:release_timestamp))
   )
end
rollback_log_message() click to toggle source
# File lib/ferry/dsl.rb, line 41
def rollback_log_message
  t(:rollback_log_message, user: local_user, release: fetch(:rollback_timestamp))
end
run_locally(&block) click to toggle source
# File lib/ferry/dsl.rb, line 58
def run_locally(&block)
  SSHKit::Backend::Local.new(&block).run
end
scm() click to toggle source
# File lib/ferry/dsl.rb, line 23
def scm
  fetch(:scm)
end
sudo(*args) click to toggle source
# File lib/ferry/dsl.rb, line 27
def sudo(*args)
  execute :sudo, *args
end
t(key, options={}) click to toggle source
# File lib/ferry/dsl.rb, line 19
def t(key, options={})
  I18n.t(key, options.merge(scope: :ferry))
end