Skip to content

Commit

Permalink
nicer output formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
knapo committed Aug 2, 2024
1 parent 6fb02e9 commit 2f69be8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/vidar/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ def pull
Log.info "Pulling #{Config.get!(:image)} tags"
Run.docker "pull #{Config.get!(:image)}:#{Config.get!(:base_stage_name)}-#{Config.get!(:current_branch)} 2> /dev/null || true"

docker_images = `docker images --format "{{.Repository}}:{{.Tag}}"`.split("\n")
image_names = `docker images --format "{{.Repository}}:{{.Tag}}"`.split("\n")
base_image = "#{Config.get!(:image)}:#{Config.get!(:base_stage_name)}-#{Config.get!(:default_branch)}"
Run.docker "pull #{base_image} 2> /dev/null || true" unless docker_images.include?(base_image)
Run.docker "pull #{base_image} 2> /dev/null || true" unless image_names.include?(base_image)

Log.info "Docker images:"
Log.info docker_images.join("\n")
image_names.each do |image_name|
puts image_name
end
end

desc "build_and_cache_base", "Build and caches base stage"
Expand Down

0 comments on commit 2f69be8

Please sign in to comment.