Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions gem/lib/pupperware/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def load_compose_services=(value)
@@load_compose_services = value
end

# may include multiple comma separated images
# returns a string if only one is present for backward compatibility
# otherwise returns an array of images
def require_test_image()
image = ENV['PUPPET_TEST_DOCKER_IMAGE']
if image.nil?
Expand All @@ -33,7 +36,7 @@ def require_test_image()
* * * * *
MSG
end
image
image.include?(',') ? image.split(',') : image
end

######################################################################
Expand Down Expand Up @@ -366,13 +369,13 @@ def get_service_container(service, timeout = 5)
# in the compose file.
# Typically the ignored service will be the one under test, since in
# that case we want to use the image we just built, not the latest released.
def pull_images(ignore_service = nil)
def pull_images(ignore_services = nil)
services = docker_compose('config --services')[:stdout].chomp
if ignore_service.nil?
if ignore_services.nil?
puts "Pulling images"
else
puts "Pulling images (ignoring image for service #{ignore_service})"
services.sub!(/^#{ignore_service}$/, '')
puts "Pulling images (ignoring image for service(s) #{ignore_services})"
[ignore_services].flatten.each { |s| services.sub!(/^#{s}$/, '') }
end
services.gsub!("\n", ' ')
docker_compose("pull --quiet #{services}", stream: STDOUT)
Expand Down