Sha256: 4c8c25e4a3be2dbaf5c3aad8262c7e08a1f90e42c2d4f736a409242b954f1b06

Contents?: true

Size: 706 Bytes

Versions: 1

Compression:

Stored size: 706 Bytes

Contents

# frozen_string_literal: true

module ContainerShip
  module Command
    module Modules
      module Docker
        def push_image(task_definition)
          sh "docker build -t \"#{task_definition.image_name}:#{task_definition.build_number}\" ."
          sh "docker push #{task_definition.image_name}:#{task_definition.build_number}"
        end

        private

        def sh(command)
          puts command

          status = nil
          Open3.popen3(command) do |_i, o, e, w|
            o.each { |line| puts line }
            e.each { |line| puts line }
            status = w.value
          end
          exit(status.exitstatus) unless status.success?
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
container_ship-0.1.5 lib/container_ship/command/modules/docker.rb