From 8bc15e098d6d2f47fb8c9a672258500755ed40f4 Mon Sep 17 00:00:00 2001 From: Dr Nic Williams Date: Mon, 11 Feb 2013 16:57:34 -0800 Subject: [PATCH] Setup the default branch "staging" in generate_generatable_options --- lib/bosh/cli/commands/cf.rb | 9 ++++++--- spec/unit/cf_command_spec.rb | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/bosh/cli/commands/cf.rb b/lib/bosh/cli/commands/cf.rb index 9818076..24f3a5a 100644 --- a/lib/bosh/cli/commands/cf.rb +++ b/lib/bosh/cli/commands/cf.rb @@ -127,7 +127,7 @@ def upload_stemcell usage "cf upload release" desc "fetch & upload latest public cloudfoundry release to BOSH" - option "--branch", String, "Create development release from branch of cf-release [default: staging]" + option "--branch branch", String, "Create development release from branch of cf-release [default: staging]" option "--final", "Upload latest final release from very latest cf-release commits" def upload_release if options.delete(:final) @@ -136,8 +136,9 @@ def upload_release else # FUTURE once all patches from https://github.com/StarkAndWayne/bosh-cloudfoundry/issues/42 # are merged into cf-release, then no more gerrit merging required - branch = options[:branch] || "staging" - set_cf_release_branch(branch) + if new_branch = options.delete(:branch) + set_cf_release_branch(new_branch) + end clone_or_update_cf_release create_and_upload_dev_release end @@ -534,6 +535,8 @@ def validate_compute_flavor(flavor) def generate_generatable_options common_password security_group + + set_cf_release_branch("staging") end # Renders the +SystemConfig+ model (+system_config+) into the system's diff --git a/spec/unit/cf_command_spec.rb b/spec/unit/cf_command_spec.rb index e39181a..f088a2d 100644 --- a/spec/unit/cf_command_spec.rb +++ b/spec/unit/cf_command_spec.rb @@ -127,7 +127,7 @@ # @cmd.should_receive(:sh).with("sed -i 's#git@github.com:#https://github.com/#g' .gitmodules") # @cmd.should_receive(:sh).with("sed -i 's#git://github.com#https://github.com#g' .gitmodules") # @cmd.should_receive(:sh).with("git submodule update --init --recursive") - # @cmd.should_receive(:write_dev_config_file).with("appcloud-dev") + # @cmd.should_receive(:write_dev_config_file).with("appcloud-staging") # @cmd.should_receive(:sh).with("bosh create release --with-tarball --force") # @cmd.should_receive(:sh).with("bosh -n --color upload release") # @cmd.upload_release @@ -199,7 +199,7 @@ def generate_new_system(cmd = nil) it "temporarily uploads latest stemcell & patched cf-release by default" do generate_new_system(@cmd) File.basename(@cmd.system).should == "production" - @cmd.system_config.release_name.should == "appcloud-dev" + @cmd.system_config.release_name.should == "appcloud-staging" end it "new system has common random password" do