github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/ci/cli/tasks/cleanup-integration.yml (about) 1 --- 2 platform: linux 3 4 image_resource: 5 type: docker-image 6 source: 7 repository: cfcli/cli-base 8 9 inputs: 10 - name: cli-ci 11 - name: cf-cli-binaries 12 - name: bosh-lock 13 - name: vars-store 14 15 outputs: 16 - name: cleanup-integration-outputs 17 18 params: 19 ARGS: 20 21 run: 22 path: bash 23 args: 24 - -c 25 - | 26 set -e 27 28 ENV=$(cat bosh-lock/name | cut -d "." -f 1) 29 CERT_DIR=$PWD/cleanup-integration-outputs/cert_dir 30 mkdir -p $CERT_DIR 31 32 pushd vars-store/ci/infrastructure/$ENV 33 if [[ "$(cat bbl-state.json | jq -r '.bblVersion')" =~ v5 ]]; then 34 eval "$(bbl5 print-env | grep -v '^ssh')" 35 export JUMPBOX_IP=$(bosh int vars/jumpbox-vars-file.yml --path /external_ip) 36 export CREDHUB_PROXY="ssh+socks5://jumpbox@${JUMPBOX_IP}:22?private-key=$JUMPBOX_PRIVATE_KEY" 37 credhub1 login --username=credhub-cli --password="$CREDHUB_PASSWORD" --server="$CREDHUB_SERVER" 38 39 export CF_INT_PASSWORD=$(credhub1 get -n /bosh-$ENV/cf/cf_admin_password | bosh interpolate --path /value -) 40 # get CA cert for go router 41 credhub1 get --name /bosh-$ENV/cf/router_ca | bosh interpolate - --path /value/certificate > $CERT_DIR/$ENV.router.ca 42 else 43 eval "$(bbl print-env)" 44 credhub login 45 46 export CF_INT_OIDC_PASSWORD=$(credhub get -n /bosh-$ENV/cf/uaa_oidc_admin_password | bosh interpolate --path /value -) 47 export CF_INT_PASSWORD=$(credhub get -n /bosh-$ENV/cf/cf_admin_password | bosh interpolate --path /value -) 48 export CF_INT_CUSTOM_CLIENT_SECRET="$(credhub get -n /bosh-${ENV}/cf/custom-client-secret | bosh interpolate --path /value -)" 49 # get CA cert for go router 50 credhub get --name /bosh-$ENV/cf/router_ca | bosh interpolate - --path /value/certificate > $CERT_DIR/$ENV.router.ca 51 fi 52 popd 53 54 set -x 55 56 # output password into a temp file for consumption by Windows 57 echo $CF_INT_PASSWORD > cleanup-integration-outputs/cf-password 58 echo $CF_INT_OIDC_PASSWORD > cleanup-integration-outputs/uaa-oidc-password 59 echo $CF_INT_CUSTOM_CLIENT_SECRET > cleanup-integration-outputs/uaa-custom-client-secret 60 61 # get CA certs for load balancer and router 62 bosh interpolate vars-store/ci/infrastructure/$ENV/bbl-state.json --path /lb/cert > $CERT_DIR/$ENV.lb.cert 63 64 set -ex 65 66 domain=$(cat bosh-lock/name) 67 export CF_INT_API="https://api.${domain}" 68 69 export PATH=$GOPATH/bin:$PATH 70 71 pushd cf-cli-binaries 72 tar xvzf cf-cli-binaries.tgz 73 chmod +x cf-cli_linux_x86-64 74 mv cf-cli_linux_x86-64 $GOPATH/bin/cf 75 popd 76 77 cd cli-ci 78 bin/cleanup-integration "${ARGS}"