Class: Tmrw::PublishCommand

Inherits:
Dry::CLI::Command
  • Object
show all
Includes:
Color
Defined in:
lib/tmrw/publish_command.rb

Instance Method Summary collapse

Methods included from Color

#blue, #green, #red

Instance Method Details

#call(name:) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/tmrw/publish_command.rb', line 9

def call(name:, **)
  tag = "registry.tomorrowhq.com/#{name}:latest"
  image = DockerImage.new(tag: tag)

  puts blue("Building docker image:")
  image.build!

  puts blue("Pushing image to registry:")
  image.push!

  puts green("Completed!")
rescue StandardError => e
  puts red(e.message)
end