From 82a4e72b03b61fcde7244ba199d834cea9849138 Mon Sep 17 00:00:00 2001 From: Carlos Konstanski Date: Sat, 10 Mar 2018 12:53:30 -0700 Subject: Choose the correct docker containers to pull at runtime Issue: IS-80 --- bootstrap/pillar_config.rb | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'bootstrap') diff --git a/bootstrap/pillar_config.rb b/bootstrap/pillar_config.rb index 2a7ccbf..772d76e 100755 --- a/bootstrap/pillar_config.rb +++ b/bootstrap/pillar_config.rb @@ -54,9 +54,10 @@ def process_yaml(branch) yml["ansible"]["build_dir"] = "/root/openbook_build/ansible" components.each do |component| yml["#{component.gsub("-", "_")}"] = { - "jar_name" => "#{component}-#{branch}", - "image_name" => "openbook_#{component.gsub("-", "_")}_#{branch}", - "container_name" => "#{component.gsub("-", "_")}_#{branch}", + "branch" => "#{branch}", + "jar_name" => "#{component}", + "image_name" => "openbook_#{component.gsub("-", "_")}", + "container_name" => "#{component.gsub("-", "_")}", "build_dir" => "/root/openbook_build/#{component.gsub("-", "_")}" } end @@ -64,18 +65,20 @@ def process_yaml(branch) end def main() - branch = "" + branch = nil opts = GetoptLong.new(["--branch", "-b", GetoptLong::REQUIRED_ARGUMENT]) - opts.each do |opt, arg| case opt when "--branch" branch = arg end end - - yml = process_yaml(branch) - puts yml.to_json + if branch + yml = process_yaml(branch) + puts yml.to_json + else + raise "--branch must be supplied." + end end main() -- cgit v1.3