Sha256: c496630f3de727d1473300e0e4ef9d35fe182997525aab3f0d878efa8ddd3f3b

Contents?: true

Size: 1.05 KB

Versions: 6

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(keys:, **args)
    super(**args)

    self.keys = 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

6 entries across 6 versions & 1 rubygems

Version Path
chamber-3.0.0rc2 lib/chamber/commands/cloud/push.rb
chamber-2.14.3 lib/chamber/commands/cloud/push.rb
chamber-3.0.0rc1 lib/chamber/commands/cloud/push.rb
chamber-2.14.2 lib/chamber/commands/cloud/push.rb
chamber-2.14.1 lib/chamber/commands/cloud/push.rb
chamber-2.14.0 lib/chamber/commands/cloud/push.rb