Class: ZeroDeploy::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/zero_deploy/processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd) ⇒ Processor

Returns a new instance of Processor.



7
8
9
10
# File 'lib/zero_deploy/processor.rb', line 7

def initialize(cmd)
  @cmd = cmd
  @time_spent = 0
end

Instance Attribute Details

#time_spentObject (readonly)

Returns the value of attribute time_spent.



5
6
7
# File 'lib/zero_deploy/processor.rb', line 5

def time_spent
  @time_spent
end

Instance Method Details

#assets_precompileObject



22
23
24
25
# File 'lib/zero_deploy/processor.rb', line 22

def assets_precompile
  action "Running: rake assets:precompile"
  action "Asset precompilation completed (0.0000001s)"
end

#bundle_installObject



16
17
18
19
20
# File 'lib/zero_deploy/processor.rb', line 16

def bundle_install
  action "Installing dependencies using Bundler version 1.4.13"
  action "Running: bundle install --without development:test:jokes"
  action "Your bundle is complete! It was installed into ./vendor/bundle"
end

#checkout_codeObject



12
13
14
# File 'lib/zero_deploy/processor.rb', line 12

def checkout_code
  action "Checkout fresh source code"
end

#finalizeObject



32
33
34
35
# File 'lib/zero_deploy/processor.rb', line 32

def finalize
  deploy = fork { Open3.popen3(@cmd) }
  Process.detach(deploy)
end

#run_migrationsObject



27
28
29
30
# File 'lib/zero_deploy/processor.rb', line 27

def run_migrations
  action "Executing deploy:migrate"
  action "No pending migrations"
end