Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only install enabled engines #936

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/cc/cli/engines/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def config
end

def pull_docker_images
config.engines.each(&method(:pull_engine))
config.engines.select(&:enabled?).each(&method(:pull_engine))
end

def pull_engine(engine)
Expand Down
16 changes: 16 additions & 0 deletions spec/cc/cli/engines/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ module CC::CLI::Engines
expect { install.run }.to raise_error(Install::ImagePullFailure)
end
end

it "excludes disabled images" do
write_cc_yaml(YAML.dump("plugins" => { "madeup" => true, "structure" => false }))
stub_engine_registry(YAML.dump(
"structure" => { "channels" => { "stable" => "structure" } },
"duplication" => { "channels" => { "stable" => "duplication" } },
"madeup" => { "channels" => { "stable" => "madeup" } },
))

install = Install.new

expect_system(install, "docker pull duplication")
expect_system(install, "docker pull madeup")

capture_io { install.run }
end
end

def expect_system(install, cmd, result = true)
Expand Down