diff options
Diffstat (limited to 'bootstrap/pillar_config.rb')
| -rwxr-xr-x | bootstrap/pillar_config.rb | 19 |
1 files changed, 11 insertions, 8 deletions
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() |
