Class: HandsomeFencer::CircleCI::DeployKeyGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- HandsomeFencer::CircleCI::DeployKeyGenerator
- Defined in:
- lib/generators/handsome_fencer/circle_c_i/deploy_key_generator.rb
Instance Method Summary collapse
Instance Method Details
#generate_deploy_key ⇒ Object
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 = [: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 |