Class: Avm::Git::Commit::Deploy

Inherits:
Object
  • Object
show all
Includes:
Files::Appendable
Defined in:
lib/avm/git/commit/deploy.rb

Instance Attribute Summary collapse

Attributes included from Files::Appendable

#variables_source

Instance Method Summary collapse

Methods included from Files::Appendable

#append_file_content, #append_plain_directory, #append_tar_output_command, #append_templatized_directories, #append_templatized_directory, #appended, #variables_source_set, #write_appended_on

Constructor Details

#initialize(commit, target_env, target_path) ⇒ Deploy

Returns a new instance of Deploy.



18
19
20
21
22
# File 'lib/avm/git/commit/deploy.rb', line 18

def initialize(commit, target_env, target_path)
  @commit = commit
  @target_env = target_env
  @target_path = target_path
end

Instance Attribute Details

#build_dirObject (readonly)

Returns the value of attribute build_dir.



16
17
18
# File 'lib/avm/git/commit/deploy.rb', line 16

def build_dir
  @build_dir
end

#commitObject (readonly)

Returns the value of attribute commit.



16
17
18
# File 'lib/avm/git/commit/deploy.rb', line 16

def commit
  @commit
end

#target_envObject (readonly)

Returns the value of attribute target_env.



16
17
18
# File 'lib/avm/git/commit/deploy.rb', line 16

def target_env
  @target_env
end

#target_pathObject (readonly)

Returns the value of attribute target_path.



16
17
18
# File 'lib/avm/git/commit/deploy.rb', line 16

def target_path
  @target_path
end

Instance Method Details

#runObject



24
25
26
27
28
29
# File 'lib/avm/git/commit/deploy.rb', line 24

def run
  fd = ::Avm::Files::Deploy.new(target_env, target_path)
  fd.append_tar_output_command(git_archive_command)
  fd.appended.push(*appended)
  fd.run
end