require 'securerandom'
require 'erb'

module Skyed
  # This module encapsulates all the Git features.
  module Git
    class << self
      def clone_stack_remote(stack, options)
        unless Skyed::Settings.current_stack?(stack[:stack_id])
          Skyed::Init.opsworks_git_key options
        end
        ENV['PKEY'] ||= Skyed::Settings.opsworks_git_key
        Skyed::Utils.create_template('/tmp', 'ssh-git', 'ssh-git.erb', 0755)
        ENV['GIT_SSH'] = '/tmp/ssh-git'
        path = "/tmp/skyed.#{SecureRandom.hex}"
        ::Git.clone(stack[:custom_cookbooks_source][:url], path)
        path
      end
    end
  end
end

require 'securerandom'
require 'erb'

module Skyed
  # This module encapsulates all the Git features.
  module Git
    class << self
      def clone_stack_remote(stack, options)
        unless Skyed::Settings.current_stack?(stack[:stack_id])
          Skyed::Init.opsworks_git_key options
        end
        puts "PKEY is: #{ENV['PKEY']}"
        ENV['PKEY'] ||= Skyed::Settings.opsworks_git_key
        Skyed::Utils.create_template('/tmp', 'ssh-git', 'ssh-git.erb', 0755)
        ENV['GIT_SSH'] = '/tmp/ssh-git'
        path = "/tmp/skyed.#{SecureRandom.hex}"
        ::Git.clone(stack[:custom_cookbooks_source][:url], path)
        path
      end
    end
  end
end

Add check to see PKEY value
INF-941: Add check to see PKEY value
