Class: AMI::IncludeHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/ami/include_helper.rb

Overview

Assists in gathering a list of files to include when bundling an AMI. Particularly useful for dealing with the EC2 AMI tools default of excluding all possibly sensitive files, even ones which are perfectly safe to distribute and are necessary to use some libraries/tools

Class Method Summary collapse

Class Method Details

.find(ssh, file_types = []) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/ami/include_helper.rb', line 8

def self.find(ssh, file_types = [])
  includes = []
  file_types.each do |type|
    response = ssh.run("sudo find / -type f -name \\*#{type}", :quiet => true)
    includes += response.output.split("\n")
    response = ssh.run("sudo find / -type l -name \\*#{type}", :quiet => true)
    includes += response.output.split("\n")
  end
  includes
end