From 1799efdff4e067219572a46463009b18fef033c9 Mon Sep 17 00:00:00 2001 From: Ollie Hughes Date: Thu, 10 Jan 2019 17:34:52 +0000 Subject: [PATCH] Add command for redeploying CF on bosh lite This includes the ops file to enable Zero Down Time deploy --- ci/scripts/manage-bosh-bbl-environment.sh | 27 +++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/ci/scripts/manage-bosh-bbl-environment.sh b/ci/scripts/manage-bosh-bbl-environment.sh index b6193b6..5a97e9c 100755 --- a/ci/scripts/manage-bosh-bbl-environment.sh +++ b/ci/scripts/manage-bosh-bbl-environment.sh @@ -167,9 +167,10 @@ deploy_cf(){ local -r bbl_state_dir=$(get_bbl_state_dir "${bbl_env_suffix}") bosh -n update-runtime-config "${bbl_state_dir}/bosh-deployment/runtime-configs/dns.yml" --name dns local -r stemcell_version=$(bosh interpolate "${bbl_state_dir}/cf-deployment/cf-deployment.yml" --path /stemcells/alias=default/version) - bosh -n upload-stemcell https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-trusty-go_agent?v=${stemcell_version} + bosh -n upload-stemcell https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-xenial-go_agent?v=${stemcell_version} bosh -n -d cf deploy "${bbl_state_dir}/cf-deployment/cf-deployment.yml" -o "${bbl_state_dir}/cf-deployment/operations/bosh-lite.yml" \ - -o "${bbl_state_dir}/cf-deployment/operations/use-compiled-releases.yml" -v system_domain="$(get_bbl_env_name ${bbl_env_suffix}).cf-app.com" + -o "${bbl_state_dir}/cf-deployment/operations/use-compiled-releases.yml" -o "${bbl_state_dir}/cf-deployment/operations/experimental/add-deployment-updater.yml" \ + -v system_domain="$(get_bbl_env_name ${bbl_env_suffix}).cf-app.com" } update_dns(){ @@ -485,6 +486,28 @@ process_command(){ recreate_environment "${bbl_env_suffix}" ;; + redeploy-cf) + shift + while getopts ":b:" FOUND "${@}"; + do + case ${FOUND} in + b) bbl_env_suffix="${OPTARG}" + ;; + \:) printf "argument missing from -%s option\n" $OPTARG + usage + exit 2 + ;; + \?) printf "unknown option: -%s\n" $OPTARG + usage + exit 2 + ;; + esac >&2 + done + generate_bbl_state_dir_for_environment "${bbl_env_suffix}" + source_bbl_environment "${bbl_env_suffix}" + deploy_cf "${bbl_env_suffix}" + ;; + delete-environment) printf "Command not yet implemented" ;;