Class: Jumpup::Deis::Integrate
- Inherits:
-
Object
- Object
- Jumpup::Deis::Integrate
- Defined in:
- lib/jumpup/deis/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_deis ⇒ Object
- #deploy ⇒ Object
- #deploy_to_production ⇒ Object
-
#initialize(app) ⇒ Integrate
constructor
A new instance of Integrate.
- #when_branch_send_to_deis(message, &block) ⇒ Object
Constructor Details
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
8 9 10 |
# File 'lib/jumpup/deis/integrate.rb', line 8 def app @app end |
Class Method Details
.add_remote ⇒ Object
26 27 28 29 30 31 |
# File 'lib/jumpup/deis/integrate.rb', line 26 def self.add_remote = "Adding Deis git remotes for app #{integrate.app}" integrate.when_branch_send_to_deis() do integrate.add_remote end end |
.check ⇒ Object
33 34 35 36 37 38 |
# File 'lib/jumpup/deis/integrate.rb', line 33 def self.check = "Checking if there's already someone integrating to #{integrate.app}" integrate.when_branch_send_to_deis() do integrate.check end end |
.deploy ⇒ Object
10 11 12 13 14 15 |
# File 'lib/jumpup/deis/integrate.rb', line 10 def self.deploy = "Starting to deploy on Deis app #{integrate.app}" integrate.when_branch_send_to_deis() do integrate.deploy end end |
.deploy_to_production ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/jumpup/deis/integrate.rb', line 17 def self.deploy_to_production app = Env.all[:production_app] integrate = new(app) = "Starting to deploy to production on Deis app #{integrate.app}" integrate.when_branch_send_to_deis() do integrate.deploy_to_production end end |
Instance Method Details
#add_remote ⇒ Object
83 84 85 86 |
# File 'lib/jumpup/deis/integrate.rb', line 83 def add_remote remote = run_with_clean_env("git remote | grep deis").strip exec_with_clean_env("git remote add deis ssh://git@#{host}:2222/#{app}.git") if remote.blank? end |
#branches_that_send_to_deis ⇒ Object
60 61 62 |
# File 'lib/jumpup/deis/integrate.rb', line 60 def branches_that_send_to_deis [Env.all[:deploy_branch], Env.all[:deploy_to_production_branch]] end |
#deploy ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/jumpup/deis/integrate.rb', line 64 def deploy run_database_checks if run_database_tasks? push(Env.all[:deploy_branch]) migrate if run_database_tasks? seed if run_database_tasks? end |
#deploy_to_production ⇒ Object
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/jumpup/deis/integrate.rb', line 72 def deploy_to_production run_database_checks if run_database_tasks? confirm_deploy spec tag push(Env.all[:deploy_to_production_branch]) migrate if run_database_tasks? seed if run_database_tasks? end |
#when_branch_send_to_deis(message, &block) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/jumpup/deis/integrate.rb', line 51 def when_branch_send_to_deis(, &block) puts "--> #{}" if branches_that_send_to_deis.include?(actual_branch) block.call else puts "----> Skipping since you are in a feature branch [#{actual_branch}]" end end |