Class: Packer::PostProcessor::ShellLocal

Inherits:
Packer::PostProcessor show all
Defined in:
lib/packer/postprocessors/shell-local.rb

Constant Summary

Constants inherited from Packer::PostProcessor

COMPRESS, DOCKER_IMPORT, DOCKER_PUSH, DOCKER_SAVE, DOCKER_TAG, SHELL_LOCAL, VAGRANT, VALID_POST_PROCESSOR_TYPES

Instance Attribute Summary

Attributes inherited from DataObject

#data, #key_dependencies, #required

Instance Method Summary collapse

Methods inherited from Packer::PostProcessor

#except, get_postprocessor, #keep_input_artifact, #only, types

Methods inherited from DataObject

#__add_array_of_array_of_strings, #__add_array_of_hashes, #__add_array_of_ints, #__add_array_of_strings, #__add_boolean, #__add_hash, #__add_integer, #__add_json, #__add_string, #__exclusive_key_error, #add_key_dependencies, #add_required, #deep_copy, #validate, #validate_key_dependencies, #validate_required

Constructor Details

#initializeShellLocal

Returns a new instance of ShellLocal.



8
9
10
11
12
# File 'lib/packer/postprocessors/shell-local.rb', line 8

def initialize
  super
  self.data['type'] = SHELL_LOCAL
  self.add_required(['inline', 'script', 'scripts'])
end

Instance Method Details

#binary(bool) ⇒ Object



25
26
27
# File 'lib/packer/postprocessors/shell-local.rb', line 25

def binary(bool)
  self.__add_boolean('binary', bool, [])
end

#environment_vars(envpairs) ⇒ Object



29
30
31
# File 'lib/packer/postprocessors/shell-local.rb', line 29

def environment_vars(envpairs)
  self.__add_array_of_strings('environment_vars', envpairs)
end

#execute_command(command) ⇒ Object



33
34
35
# File 'lib/packer/postprocessors/shell-local.rb', line 33

def execute_command(command)
  self.__add_string('execute_command', command)
end

#inline(commands) ⇒ Object



13
14
15
# File 'lib/packer/postprocessors/shell-local.rb', line 13

def inline(commands)
  self.__add_array_of_strings('inline', commands, %w[script scripts])
end

#inline_shebang(command) ⇒ Object



37
38
39
# File 'lib/packer/postprocessors/shell-local.rb', line 37

def inline_shebang(command)
  self.__add_string('inline_shebang', command)
end

#remote_path(command) ⇒ Object



41
42
43
# File 'lib/packer/postprocessors/shell-local.rb', line 41

def remote_path(command)
  self.__add_string('remote_path', command)
end

#script(filename) ⇒ Object



17
18
19
# File 'lib/packer/postprocessors/shell-local.rb', line 17

def script(filename)
  self.__add_string('script', filename, %w[inline scripts])
end

#scripts(filenames) ⇒ Object



21
22
23
# File 'lib/packer/postprocessors/shell-local.rb', line 21

def scripts(filenames)
  self.__add_array_of_strings('scripts', filenames, %w[inline script])
end