Class: Deis::Commands::Deploy
- Inherits:
-
Struct
- Object
- Struct
- Deis::Commands::Deploy
- Includes:
- Helpers
- Defined in:
- lib/deis/commands/deploy.rb
Overview
Deploy a deis repo
Constant Summary collapse
- LAST_MIGRATION_CMD =
%{bundle exec rake db:migrate:status}
- MIGRATION_REGEX =
/up\s+(?<migration>[0-9]{8}[0-9])+/
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#ref ⇒ Object
Returns the value of attribute ref.
-
#web_count ⇒ Object
readonly
Returns the value of attribute web_count.
-
#worker_count ⇒ Object
readonly
Returns the value of attribute worker_count.
Instance Method Summary collapse
Methods included from Helpers
#app_exists?, #capture_output, #capture_syscall, #deis_command, #deis_local_command, #deis_login!, #deploy, #get_runner, #get_units!, #git_clone, #increment_retry!, #reset_retry!, #run_util, #scale, seconds_to_human, #shell, #should_retry?, #status, #units
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
4 5 6 |
# File 'lib/deis/commands/deploy.rb', line 4 def app @app end |
#ref ⇒ Object
Returns the value of attribute ref
4 5 6 |
# File 'lib/deis/commands/deploy.rb', line 4 def ref @ref end |
#web_count ⇒ Object (readonly)
Returns the value of attribute web_count.
11 12 13 |
# File 'lib/deis/commands/deploy.rb', line 11 def web_count @web_count end |
#worker_count ⇒ Object (readonly)
Returns the value of attribute worker_count.
10 11 12 |
# File 'lib/deis/commands/deploy.rb', line 10 def worker_count @worker_count end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/deis/commands/deploy.rb', line 13 def run status "Deploying `#{ref}` to `#{app}` on Deis" precheck_migrations! output = deploy info['git_url'], ref: ref if output.include? 'Another git push is ongoing' sleep 60 # one minute return run_util 'deploy', app, ref end run_migrations! if needs_migrations? rescue NonZeroExitError => e raise e unless e..include? 'Another git push is ongoing' remove_instance_variable :@needs_migrations sleep 60 retry end |