Class: TerraformWrapper::Tasks::Upgrade
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- TerraformWrapper::Tasks::Upgrade
- Includes:
- Shared::Logging
- Defined in:
- lib/terraform-wrapper/tasks/upgrade.rb
Instance Method Summary collapse
-
#initialize(binary:, code:) {|_self| ... } ⇒ Upgrade
constructor
A new instance of Upgrade.
- #upgrade_task ⇒ Object
Methods included from Shared::Logging
configure_logger_for, logger_for
Constructor Details
#initialize(binary:, code:) {|_self| ... } ⇒ Upgrade
Returns a new instance of Upgrade.
21 22 23 24 25 26 27 28 |
# File 'lib/terraform-wrapper/tasks/upgrade.rb', line 21 def initialize(binary:, code:) @binary = binary @code = code yield self if block_given? upgrade_task end |
Instance Method Details
#upgrade_task ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/terraform-wrapper/tasks/upgrade.rb', line 32 def upgrade_task desc 'Upgrades the Terraform infrastructure component modules, providers and lock file.' task upgrade: [:binary] do |_t, _args| runner = TerraformWrapper::Shared::Runner.new(binary: @binary, code: @code) logger.info("Upgrading Terraform component: #{@code.name}...") runner.upgrade end end |