Module: Deployinator::Stacks::Demo

Defined in:
stacks/demo.rb

Instance Method Summary collapse

Instance Method Details

#checkout_rootObject


12
13
14
# File 'stacks/demo.rb', line 12

def checkout_root
  "/tmp"
end

#demo_git_checkout_pathObject


8
9
10
# File 'stacks/demo.rb', line 8

def demo_git_checkout_path
  "#{checkout_root}/#{stack}"
end

#demo_git_repo_urlObject


4
5
6
# File 'stacks/demo.rb', line 4

def demo_git_repo_url
  "git://github.com/etsy/statsd.git"
end

#demo_head_buildObject


24
25
26
# File 'stacks/demo.rb', line 24

def demo_head_build
  %x{git ls-remote #{demo_git_repo_url} HEAD | cut -c1-7}.chomp
end

#demo_production(options = {}) ⇒ Object


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'stacks/demo.rb', line 28

def demo_production(options={})
  old_build = Version.get_build(demo_production_version)

  git_cmd = old_build ? :git_freshen_clone : :github_clone
  send(git_cmd, stack, "sh -c")

  git_bump_version stack, ""

  build = demo_head_build

  begin
    run_cmd %Q{echo "ssh host do_something"}
    log_and_stream "Done!<br>"
  rescue
    log_and_stream "Failed!<br>"
  end

  # log this deploy / timing
  log_and_shout(:old_build => old_build, :build => build, :send_email => true)
end

#demo_production_buildObject


20
21
22
# File 'stacks/demo.rb', line 20

def demo_production_build
  Version.get_build(demo_production_version)
end

#demo_production_versionObject


16
17
18
# File 'stacks/demo.rb', line 16

def demo_production_version
  %x{cat #{demo_git_checkout_path}/version.txt}
end