Class: Jumpup::Heroku::Integrate
- Inherits:
-
Object
- Object
- Jumpup::Heroku::Integrate
- Defined in:
- lib/jumpup/heroku/integrate.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Class Method Summary collapse
- .add_remote ⇒ Object
- .check ⇒ Object
- .deploy ⇒ Object
- .deploy_to_production ⇒ Object
- .integrate ⇒ Object
Instance Method Summary collapse
- #add_remote ⇒ Object
- #branches_that_send_to_heroku ⇒ Object
- #check ⇒ Object
- #deploy ⇒ Object
- #deploy_to_production ⇒ Object
-
#initialize(app) ⇒ Integrate
constructor
A new instance of Integrate.
- #when_branch_send_to_heroku(message, &block) ⇒ Object
Constructor Details
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
8 9 10 |
# File 'lib/jumpup/heroku/integrate.rb', line 8 def app @app end |
Class Method Details
.add_remote ⇒ Object
26 27 28 29 30 31 |
# File 'lib/jumpup/heroku/integrate.rb', line 26 def self.add_remote = "Adding Heroku git remotes for app #{integrate.app}" integrate.when_branch_send_to_heroku() do integrate.add_remote end end |
.check ⇒ Object
33 34 35 36 37 38 |
# File 'lib/jumpup/heroku/integrate.rb', line 33 def self.check = "Checking if you can integrate to #{integrate.app}" integrate.when_branch_send_to_heroku() do integrate.check end end |
.deploy ⇒ Object
10 11 12 13 14 15 |
# File 'lib/jumpup/heroku/integrate.rb', line 10 def self.deploy = "Starting to deploy on Heroku app #{integrate.app}" integrate.when_branch_send_to_heroku() do integrate.deploy end end |
.deploy_to_production ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/jumpup/heroku/integrate.rb', line 17 def self.deploy_to_production app = Env.all[:production_app] integrate = new(app) = "Starting to deploy to production on Heroku app #{integrate.app}" integrate.when_branch_send_to_heroku() do integrate.deploy_to_production end end |
Instance Method Details
#add_remote ⇒ Object
90 91 92 93 |
# File 'lib/jumpup/heroku/integrate.rb', line 90 def add_remote remote = run_with_clean_env("git remote | grep heroku").strip exec_with_clean_env("git remote add heroku [email protected]:#{app}.git") if remote.blank? end |
#branches_that_send_to_heroku ⇒ Object
60 61 62 |
# File 'lib/jumpup/heroku/integrate.rb', line 60 def branches_that_send_to_heroku [Env.all[:deploy_branch], Env.all[:deploy_to_production_branch]] end |
#check ⇒ Object
95 96 97 98 99 100 |
# File 'lib/jumpup/heroku/integrate.rb', line 95 def check unless authenticated_on_heroku? puts "----> You haven't logged in to heroku, please run `heroku login`" exit 1 end end |
#deploy ⇒ Object
64 65 66 67 68 69 70 71 72 |
# File 'lib/jumpup/heroku/integrate.rb', line 64 def deploy run_database_checks if run_database_tasks? backup if run_database_tasks? and !skip_backup? push(Env.all[:deploy_branch]) migrate if run_database_tasks? seed if run_database_tasks? restart end |
#deploy_to_production ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/jumpup/heroku/integrate.rb', line 74 def deploy_to_production run_database_checks if run_database_tasks? confirm_deploy spec unless skip_spec? confirm_maintenance maintenance backup if run_database_tasks? and !skip_backup? tag push(Env.all[:deploy_to_production_branch]) migrate if run_database_tasks? seed if run_database_tasks? close_maintenance restart end |
#when_branch_send_to_heroku(message, &block) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/jumpup/heroku/integrate.rb', line 51 def when_branch_send_to_heroku(, &block) puts "--> #{}" if branches_that_send_to_heroku.include?(actual_branch) block.call else puts "----> Skipping since you are in a feature branch [#{actual_branch}]" end end |