class Dolphin::Deploy

Deploy tasks

Public Instance Methods

bundle() click to toggle source
# File lib/dolphin/deploy.rb, line 5
def bundle
  menu = [
    "
      cd #{@deploy_dir}
      sudo bundle install --quiet
    ",
  ]

  execute menu
end
go() click to toggle source
# File lib/dolphin/deploy.rb, line 17
def go
  # check lock
  invoke "dolphin:lock:check"
  # put lock
  invoke "dolphin:lock:create"

  # update code
  invoke "dolphin:git:update"

  # no need to invoke since it is within the same class
  bundle

  # restart app server
  invoke "dolphin:puma:restart"

  # remove lock
  invoke "dolphin:lock:release"
end
newrelic() click to toggle source
# File lib/dolphin/deploy.rb, line 69
def newrelic
  menu = [
    "
      sudo /etc/init.d/newrelic-sysmond start
    ",
  ]

  execute menu
end
rollback(tag=nil) click to toggle source
# File lib/dolphin/deploy.rb, line 37
def rollback(tag=nil)
  # check lock, must explicitly not passing arguments
  invoke "dolphin:lock:check", []
  # put lock
  invoke "dolphin:lock:create", []

  # checkout tag
  invoke "dolphin:git:checkout"

  # restart app server
  invoke "dolphin:puma:restart", []

  # remove lock
  invoke "dolphin:lock:release", []
end
try() click to toggle source
# File lib/dolphin/deploy.rb, line 54
def try
  menu = [
    "
      cd #{@deploy_dir}
      pwd
      chruby
      which bundle
      bundle check
    ",
  ]

  execute menu
end