Class: Njord::DockerHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/njord/docker_handler.rb

Class Method Summary collapse

Class Method Details

.build_imagesObject



6
7
8
9
10
11
# File 'lib/njord/docker_handler.rb', line 6

def build_images
  Njord.config.images.each do |image_config|
    execute("docker build #{build_args(image_config)}-t #{image_config.image_name}:#{image_tag(image_config)}" \
      " -f #{image_config.dockerfile} .")
  end
end

.push_imagesObject



20
21
22
23
24
25
# File 'lib/njord/docker_handler.rb', line 20

def push_images
  Njord.config.images.each do |image_config|
    execute("docker push #{image_config.docker_repo}/#{image_config.image_name}:#{image_tag(image_config)}")
    execute("docker push #{image_config.docker_repo}/#{image_config.image_name}:latest")
  end
end

.tag_imagesObject



13
14
15
16
17
18
# File 'lib/njord/docker_handler.rb', line 13

def tag_images
  Njord.config.images.each do |image_config|
    execute("docker tag #{image_config.image_name}:#{image_tag(image_config)} #{image_config.docker_repo}/#{image_config.image_name}:#{image_tag(image_config)}")
    execute("docker tag #{image_config.image_name}:#{image_tag(image_config)} #{image_config.docker_repo}/#{image_config.image_name}:latest")
  end
end