Class: Instapusher2::Commands
- Inherits:
-
Object
- Object
- Instapusher2::Commands
- Defined in:
- lib/instapusher2/commands.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#branch_name ⇒ Object
readonly
Returns the value of attribute branch_name.
-
#debug ⇒ Object
readonly
Returns the value of attribute debug.
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
Instance Method Summary collapse
- #deploy ⇒ Object
-
#initialize(init_options = {}) ⇒ Commands
constructor
A new instance of Commands.
Constructor Details
#initialize(init_options = {}) ⇒ Commands
Returns a new instance of Commands.
10 11 12 13 14 15 16 17 18 |
# File 'lib/instapusher2/commands.rb', line 10 def initialize = {} @debug = [:debug] @quick = [:quick] @local = [:local] git = Git.new @branch_name = [:project_name] || ENV['INSTAPUSHER_BRANCH'] || git.current_branch @project_name = [:branch_name] || ENV['INSTAPUSHER_PROJECT'] || git.project_name end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/instapusher2/commands.rb', line 8 def api_key @api_key end |
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name.
8 9 10 |
# File 'lib/instapusher2/commands.rb', line 8 def branch_name @branch_name end |
#debug ⇒ Object (readonly)
Returns the value of attribute debug.
8 9 10 |
# File 'lib/instapusher2/commands.rb', line 8 def debug @debug end |
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
8 9 10 |
# File 'lib/instapusher2/commands.rb', line 8 def project_name @project_name end |
Instance Method Details
#deploy ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/instapusher2/commands.rb', line 20 def deploy verify_api_key #SpecialInstructionForProduction.new.run if production? job_submission = JobSubmission.new(debug, ) job_submission.submit_the_job if job_submission.success? job_submission.feedback_to_user TagTheRelease.new(branch_name, debug).tagit if production? else puts job_submission. end end |