Sha256: 30781fcb86e0c11cdf3c34c1665605593fa79d4b95fa2f03fa7fe5311e827bad

Contents?: true

Size: 449 Bytes

Versions: 7

Compression:

Stored size: 449 Bytes

Contents

module HandsomeFencer
  module CircleCI
    class CLI < Thor

      desc "generate_key", "(Re)generate a key for each environment"

      def generate_key(*args)
        environment = args.first ? args.first : "deploy"

        @cipher = OpenSSL::Cipher.new 'AES-128-CBC'
        @salt = '8 octets'
        @new_key = @cipher.random_key

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
handsome_fencer-circle_c_i-0.1.26 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.25 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.24 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.23 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.22 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.21 lib/handsome_fencer/circle_c_i/cli/generate_key.rb
handsome_fencer-circle_c_i-0.1.20 lib/handsome_fencer/circle_c_i/cli/generate_key.rb