Sha256: ad78ce6972846c9e427b3cae2722ff8f027b26bdee56510d4f1b664308315a1f

Contents?: true

Size: 633 Bytes

Versions: 7

Compression:

Stored size: 633 Bytes

Contents

module HandsomeFencer
  module CircleCI
    class CLI < Thor
      map "generate_keys" => "generate_key"
      desc "generate_key", "(Re)generate a key for each environment"

      def generate_key(*args)
        default_environments = %w[circleci development production]
        environments = args.first ? [args.first] : default_environments
        environments.each do |environment|
          @cipher = OpenSSL::Cipher.new 'AES-128-CBC'
          @salt = '8 octets'
          @new_key = @cipher.random_key

          create_file "docker/keys/#{environment}.key", Base64.encode64(@new_key)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
handsome_fencer-circle_c_i-0.1.44 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.43 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.42 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.41 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.40 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.39 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.38 lib/handsome_fencer/circle_c_i/cli/generate_key.rb