Class: Shipitron::Server::Docker::PushImage

Inherits:
Object
  • Object
show all
Includes:
Metaractor
Defined in:
lib/shipitron/server/docker/push_image.rb

Instance Method Summary collapse

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/shipitron/server/docker/push_image.rb', line 13

def call
  return if context.skip_push

  Logger.info "Pushing docker image #{docker_image} and #{docker_image.name_with_tag(named_tag)}"

  Logger.info `docker tag #{docker_image} #{docker_image.name_with_tag(named_tag)}`
  if $? != 0
    fail_with_error!(message: 'Docker tag failed.')
  end

  Logger.info `docker push #{docker_image}`
  if $? != 0
    fail_with_error!(message: 'Docker push failed.')
  end

  Logger.info `docker push #{docker_image.name_with_tag(named_tag)}`
  if $? != 0
    fail_with_error!(message: "Docker push (#{named_tag}) failed.")
  end
end