Created
September 26, 2017 04:00
-
-
Save drnic/6f3b9c355f8feeaf220142c9a92019ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
: ${NAME:?required, e.g. bosh-lite-10} | |
export CF_DEPLOYMENT=${CF_DEPLOYMENT:-~/Projects/bosh_deployments/cf-deployment} | |
[[ -f $CF_DEPLOYMENT/cf-deployment.yml ]] || { echo "Please set \$CF_DEPLOYMENT"; exit 1; } | |
export BOSH_ENVIRONMENT=vsphere-prod | |
export BOSH_DEPLOYMENT=$NAME | |
# vsphere_cloud_config=$(bosh cloud-config) | |
[[ -n $DELETE_DEPLOYMENT ]] && { bosh delete-deployment --force -n; } | |
[[ -z $SKIP_DEPLOYMENT ]] && { | |
bosh -n deploy bosh-deployment/bosh.yml \ | |
-o bosh-deployment/bosh-lite.yml \ | |
-o bosh-deployment/bosh-lite-runc.yml \ | |
-o bosh-deployment/misc/bosh-dev.yml \ | |
-o bosh/operations.yml \ | |
-l bosh/$NAME/vars.yml \ | |
--vars-store bosh-credentials/$NAME.yml | |
} | |
ip=$(bosh int bosh/$NAME/vars.yml --path /internal_ip) | |
set -x | |
export BOSH_CLIENT=admin | |
export BOSH_CLIENT_SECRET="$(bosh int bosh-credentials/$NAME.yml --path /admin_password)" | |
set +x | |
bosh -e https://$ip:25555 --ca-cert <(bosh int bosh-credentials/$NAME.yml --path /director_ssl/ca) alias-env $NAME | |
cd $CF_DEPLOYMENT | |
export BOSH_ENVIRONMENT=$NAME | |
export BOSH_DEPLOYMENT=cf | |
export BOSH_CLIENT=admin | |
export BOSH_CLIENT_SECRET=admin | |
bosh upload-stemcell https://s3.amazonaws.com/bosh-core-stemcells/warden/bosh-stemcell-$(bosh int cf-deployment.yml --path /stemcells/os=ubuntu-trusty/version)-warden-boshlite-ubuntu-trusty-go_agent.tgz | |
bosh update-cloud-config bosh-lite/cloud-config.yml -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment