Class: Rain::Deployer

Inherits:
Thor
  • Object
show all
Includes:
GitTools, Thor::Actions
Defined in:
lib/rain/deployer.rb

Instance Method Summary collapse

Methods included from GitTools

#git_name, #last_release_tag, #no_changes_pending?, #on_master?, #push_tag, #run_cmd, #tagged_latest_version?, #update_release_tag, #versions_hash, #versions_path, #working_directory_copasetic?

Instance Method Details

#on(environment = "production") ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rain/deployer.rb', line 15

def on environment="production"
  say "Making it rain on #{environment}..."

  return unless working_directory_copasetic?(options)

  unless options[:"keep-current-version"] || environment == 'production'
    update_release_tag(environment, tag.to_s)
    run_cmd("git tag #{tag.to_s}")
    push_tag(tag)
  else
    update_release_tag(environment, GitTools::ReleaseTag.current("staging"))
    say "Deploying existing tag #{GitTools::ReleaseTag.current("staging")} to '#{environment}'."
  end

  run "bundle exec cap #{environment} deploy"

  say "Got a handful of stacks better grab an umbrella."
end