Class: HelmWrapper::Tasks::Apply
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- HelmWrapper::Tasks::Apply
- Includes:
- Shared::Logging
- Defined in:
- lib/helm-wrapper/tasks/apply.rb
Instance Method Summary collapse
- #apply_task ⇒ Object
-
#initialize(binary:, chart:, options:) {|_self| ... } ⇒ Apply
constructor
A new instance of Apply.
Methods included from Shared::Logging
configure_logger_for, logger_for
Constructor Details
#initialize(binary:, chart:, options:) {|_self| ... } ⇒ Apply
Returns a new instance of Apply.
25 26 27 28 29 30 31 32 33 |
# File 'lib/helm-wrapper/tasks/apply.rb', line 25 def initialize(binary:, chart:, options:) @binary = binary @chart = chart = yield self if block_given? apply_task end |
Instance Method Details
#apply_task ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/helm-wrapper/tasks/apply.rb', line 37 def apply_task desc "Applies chart with Helm for a given configuration." task :apply, [:config, :clean] => :binary do |t, args| = .merge({"name" => args[:config]}) clean = args[:clean].kind_of?(String) ? args[:clean].downcase == "true" : true logger.info("Processing configuration for Helm apply...") config = HelmWrapper::Shared::Config.new(chart: @chart, options: ) runner = HelmWrapper::Shared::Runner.new(binary: @binary, chart: @chart, config: config) logger.info("Running Helm upgrade for release: #{config.release}, namespace: #{config.namespace}...") begin runner.init_repos runner.init_auths runner.upgrade ensure runner.clean(repos: clean) end end end |