Sha256: 58faa2e4462ba5db22b27c1a1a1e1bf663c15993b040e8c5f687de670ca9e94d

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require 'chamber/commands/cloud/base'
require 'chamber/commands/securable'
require 'chamber/keys/decryption'

module  Chamber
module  Commands
module  Cloud
class   Push < Chamber::Commands::Cloud::Base
  include Chamber::Commands::Securable

  attr_accessor :keys

  def initialize(options = {})
    super

    self.keys = options[:keys]
  end

  def call
    environment_variables = if keys
                              Keys::Decryption.
                                new(rootpath:   chamber.configuration.rootpath,
                                    namespaces: chamber.configuration.namespaces).
                                as_environment_variables
                            else
                              securable_environment_variables
                            end

    environment_variables.each do |key, value|
      if dry_run
        shell.say_status 'push', key, :blue
      else
        shell.say_status 'push', key, :green

        adapter.add_environment_variable(key, value)
      end
    end
  end
end
end
end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chamber-2.13.1 lib/chamber/commands/cloud/push.rb
chamber-2.13.0 lib/chamber/commands/cloud/push.rb