Class: Jets::Command::Rollback
- Inherits:
-
Object
- Object
- Jets::Command::Rollback
- Includes:
- ApiHelpers
- Defined in:
- lib/jets/commands/rollback/rollback_command.rb
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Rollback
constructor
A new instance of Rollback.
- #run ⇒ Object
Methods included from ApiHelpers
#check_for_error_message!, #no_token_exit!, #paging_params
Constructor Details
#initialize(options = {}) ⇒ Rollback
Returns a new instance of Rollback.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jets/commands/rollback/rollback_command.rb', line 15 def initialize(={}) = @version = [:version] # Handle more gracefully than the way Jets does it currently if @version.nil? puts " ERROR: version required\n Usage: jets rollback VERSION\n EOL\n exit 1\n end\nend\n" |
Instance Attribute Details
#version ⇒ Object (readonly)
Returns the value of attribute version.
14 15 16 |
# File 'lib/jets/commands/rollback/rollback_command.rb', line 14 def version @version end |
Instance Method Details
#run ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/jets/commands/rollback/rollback_command.rb', line 28 def run no_token_exit! Jets.boot payload = Release.new().get(version) (payload) puts "Rolling back to version #{version}" # Download previous cfn templates Jets::Cfn::Download.new.download_templates(version) # Run cloudformation update Jets::Cfn::Ship.new(.merge(rollback_version: version)).run # also creates the Jets Api deployment record end |