Class: DockerComposeDeploy::Actions::Image

Inherits:
Struct
  • Object
show all
Defined in:
lib/docker_compose_deploy/actions/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/docker_compose_deploy/actions/image.rb', line 6

def name
  @name
end

#shellObject

Returns the value of attribute shell

Returns:

  • (Object)

    the current value of shell



6
7
8
# File 'lib/docker_compose_deploy/actions/image.rb', line 6

def shell
  @shell
end

Instance Method Details

#pushObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/docker_compose_deploy/actions/image.rb', line 8

def push
  shell.notify "Pushing #{name} to remote"

  shell.run!("docker save #{name} > #{tmp_file_path}")
  shell.run!("bzip2 #{tmp_file_path}")
  shell.scp!("#{tmp_file_path}.bz2", "#{connection}:/tmp/")
  shell.run!("rm #{tmp_file_path}.bz2")
  shell.ssh!("docker load -i /tmp/#{filename}.bz2")

  shell.notify "success"
end