Class: Jumpup::Heroku::Integrate
- Inherits:
-
Object
- Object
- Jumpup::Heroku::Integrate
- Defined in:
- lib/jumpup/heroku/integrate.rb
Class Method Summary collapse
- .add_remote ⇒ Object
- .check ⇒ Object
- .deploy ⇒ Object
- .deploy_to_production ⇒ Object
- .integrate ⇒ Object
- .lock ⇒ Object
- .unlock ⇒ Object
Instance Method Summary collapse
- #add_remote ⇒ Object
- #check ⇒ Object
- #deploy ⇒ Object
- #deploy_to_production ⇒ Object
-
#initialize(app) ⇒ Integrate
constructor
A new instance of Integrate.
- #lock ⇒ Object
- #unlock ⇒ Object
Constructor Details
Class Method Details
.add_remote ⇒ Object
15 16 17 |
# File 'lib/jumpup/heroku/integrate.rb', line 15 def self.add_remote integrate.add_remote end |
.check ⇒ Object
19 20 21 |
# File 'lib/jumpup/heroku/integrate.rb', line 19 def self.check integrate.check end |
.deploy ⇒ Object
6 7 8 |
# File 'lib/jumpup/heroku/integrate.rb', line 6 def self.deploy integrate.deploy end |
.deploy_to_production ⇒ Object
10 11 12 13 |
# File 'lib/jumpup/heroku/integrate.rb', line 10 def self.deploy_to_production app = Env.all[:production_app] new(app).deploy_to_production end |
.integrate ⇒ Object
31 32 33 34 35 |
# File 'lib/jumpup/heroku/integrate.rb', line 31 def self.integrate envs = Env.all app = envs[:app] || envs[:staging_app] new(app) end |
.lock ⇒ Object
23 24 25 |
# File 'lib/jumpup/heroku/integrate.rb', line 23 def self.lock integrate.lock end |
.unlock ⇒ Object
27 28 29 |
# File 'lib/jumpup/heroku/integrate.rb', line 27 def self.unlock integrate.unlock end |
Instance Method Details
#add_remote ⇒ Object
64 65 66 67 68 |
# File 'lib/jumpup/heroku/integrate.rb', line 64 def add_remote puts "--> Adding Heroku git remotes for app #{app}" remote = run_with_clean_env("git remote | grep heroku", true).strip run_with_clean_env("git remote add heroku [email protected]:#{app}.git") if remote.blank? end |
#check ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/jumpup/heroku/integrate.rb', line 70 def check puts "--> Checking if there's already someone integrating to #{app}" var = run_with_clean_env("heroku config -s --app #{app} | grep INTEGRATING_BY", true).strip = var.split('=')[1] .strip! unless .blank? if != user and not .blank? puts "--> Project is already being integrated by '#{}', halting" exit end end |
#deploy ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/jumpup/heroku/integrate.rb', line 42 def deploy backup push migrate seed restart end |
#deploy_to_production ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/jumpup/heroku/integrate.rb', line 50 def deploy_to_production confirm_deploy spec confirm_maintenance maintenance backup tag push migrate seed close_maintenance restart end |
#lock ⇒ Object
84 85 86 87 |
# File 'lib/jumpup/heroku/integrate.rb', line 84 def lock puts "--> Locking Heroku integration for you (#{user})" run_with_clean_env("heroku config:set INTEGRATING_BY='#{user}' --app #{app}") end |
#unlock ⇒ Object
89 90 91 92 |
# File 'lib/jumpup/heroku/integrate.rb', line 89 def unlock puts "--> Unlocking Heroku integration" run_with_clean_env("heroku config:unset INTEGRATING_BY --app #{app}") end |