github.com/jenspinney/cli@v6.42.1-0.20190207184520-7450c600020e+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          # get CA cert for go router
    49          credhub get --name /bosh-$ENV/cf/router_ca | bosh interpolate - --path /value/certificate > $CERT_DIR/$ENV.router.ca
    50        fi
    51      popd
    52  
    53      set -x
    54  
    55      # output password into a temp file for consumption by Windows
    56      echo $CF_INT_PASSWORD > cleanup-integration-outputs/cf-password
    57      echo $CF_INT_OIDC_PASSWORD > cleanup-integration-outputs/uaa-oidc-password
    58  
    59      # get CA certs for load balancer and router
    60      bosh interpolate vars-store/ci/infrastructure/$ENV/bbl-state.json --path /lb/cert > $CERT_DIR/$ENV.lb.cert
    61  
    62      set -ex
    63  
    64      domain=$(cat bosh-lock/name)
    65      export CF_INT_API="https://api.${domain}"
    66  
    67      export PATH=$GOPATH/bin:$PATH
    68  
    69      pushd cf-cli-binaries
    70        tar xvzf cf-cli-binaries.tgz
    71        chmod +x cf-cli_linux_x86-64
    72        mv cf-cli_linux_x86-64 $GOPATH/bin/cf
    73      popd
    74  
    75      cd cli-ci
    76      bin/cleanup-integration "${ARGS}"