Class: HandsomeFencer::CircleCI::DeployKeyGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/handsome_fencer/circle_c_i/deploy_key_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_deploy_keyObject



10
11
12
13
14
15
16
17
# File 'lib/generators/handsome_fencer/circle_c_i/deploy_key_generator.rb', line 10

def generate_deploy_key
  environment = options[:environment]
  @cipher = OpenSSL::Cipher.new 'AES-128-CBC'
  @salt = '8 octets'
  @new_key = @cipher.random_key

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