Class: Sibling::Deploy

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/sibling/deploy.rb

Instance Method Summary collapse

Instance Method Details

#async_deployObject



50
51
52
53
54
55
56
# File 'app/models/sibling/deploy.rb', line 50

def async_deploy
  queue!
  Resque.enqueue(SiblingDeployer, self.id)
rescue StandardError => e
  fail!
  raise e
end

#deployObject



32
33
34
35
36
37
38
39
40
41
42
# File 'app/models/sibling/deploy.rb', line 32

def deploy
  start!

  GithubHerokuDeployer.deploy(deployer_options)
  GithubHerokuDeployer.heroku_run("rake db:migrate", deployer_options)

  succeed!
rescue StandardError => e
  fail!
  raise e
end

#deployer_optionsObject



44
45
46
47
48
# File 'app/models/sibling/deploy.rb', line 44

def deployer_options
  { github_repo: git_repo,
    heroku_repo: heroku_repo,
    heroku_app_name: heroku_app_name }
end