Class: Railshoster::DeployCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/railshoster/deploy_command.rb

Overview

This action class helps to deploy a rails applicaton

Instance Method Summary collapse

Methods included from GeneralCapistranoHelpers

#capistrano_greater_than_2?, #installed_capistrano_version

Constructor Details

#initialize(project_dir) ⇒ DeployCommand

Returns a new instance of DeployCommand.



6
7
8
# File 'lib/railshoster/deploy_command.rb', line 6

def initialize(project_dir)
  super(project_dir)
end

Instance Method Details

#deployObject



10
11
12
13
14
15
16
17
18
# File 'lib/railshoster/deploy_command.rb', line 10

def deploy
  if_project_already_initialized do
    if capistrano_greater_than_2?
      system("cap production deploy")
    else
      system("cap deploy")
    end
  end
end

#deploy_coldObject



30
31
32
33
34
35
36
37
38
# File 'lib/railshoster/deploy_command.rb', line 30

def deploy_cold
  if_project_already_initialized do
    if capistrano_greater_than_2?
      system("cap production deploy:cold")
    else
      system("cap deploy:cold")
    end
  end
end

#deploy_setupObject



20
21
22
23
24
25
26
27
28
# File 'lib/railshoster/deploy_command.rb', line 20

def deploy_setup
  if_project_already_initialized do
    if capistrano_greater_than_2?
      system("cap production deploy:setup")
    else
      system("cap deploy:setup")
    end
  end
end