1919 name :
2020 required : true
2121 type : string
22- pool-name :
23- type : string
24- default : ${{ vars.SHEPHERD_POOL_NAME }}
25- pool-namespace :
22+ lease-id :
23+ required : true
2624 type : string
27- default : ' official'
2825 gitRef :
2926 type : string
3027 default : ${{github.event.workflow_run.head_sha}}
@@ -50,78 +47,41 @@ jobs:
5047 ref : release-candidate
5148 path : cf-acceptance-tests
5249
53- - name : Checkout cf-deployment
54- uses : actions/checkout@v4
55- with :
56- repository : cloudfoundry/cf-deployment
57- path : cf-deployment
58-
5950 - name : Checkout CF deployment tasks
6051 uses : actions/checkout@v4
6152 with :
6253 repository : cloudfoundry/cf-deployment-concourse-tasks
6354 path : cf-deployment-concourse-tasks
6455
65- - id : claim-env
66- name : Claim Environment
67- env :
68- account_token : ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }}
69- pool_name : ${{ inputs.pool-name }}
70- pool_namespace : ${{ inputs.pool-namespace }}
71- run : |
72- shepherd login service-account ${account_token}
73-
74- echo "shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace ${pool_namespace} --namespace tas-devex --description 'CLI GHA'"
75- lease_id=$(shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace ${pool_namespace} --namespace tas-devex --json | jq -r .id)
76- # Give sometime for the lease to complete. Shepherd may take upto an 3 hours to create an env
77- # if the pool is empty.
78- count=0
79- while [ $count -lt 360 ] ; do
80- sleep 30
81- status=$(shepherd get lease ${lease_id} --namespace tas-devex --json | jq -r .status)
82- if [ $status == "LEASED" ] ; then
83- shepherd get lease ${lease_id} --namespace tas-devex --json | jq .output > metadata.json
84- break
85- elif [ $status == "FAILED" -o $status == "EXPIRED" ] ; then
86- echo "There was an error obtaining the lease. Lease status is ${status}."
87- exit 1
88- else
89- echo "Waiting for environment to be ready. Lease status is ${status}."
90- fi
91- count=$(($count+1))
92- done
93-
94- env_name=$(jq -r .name metadata.json)
95- cat metadata.json | jq -r '.name'
96- echo "lease-id=$lease_id" >> "${GITHUB_OUTPUT}"
97-
9856 - name : Set Up Go
9957 uses : actions/setup-go@v5
10058 with :
10159 go-version-file : go.mod
10260 check-latest : true
10361
10462 - name : Install Tools
63+ env :
64+ account_token : ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }}
10565 run : |
10666 go version
10767
10868 if [[ ${{ inputs.os }} =~ "windows" ]]
10969 then
11070 install_location=/usr/bin
11171 bbl_artifact=bbl-v8.4.110_windows.exe
112- bosh_cli_artifact=bosh-cli-7.0.1 -windows-amd64.exe
72+ bosh_cli_artifact=bosh-cli-7.7.2 -windows-amd64.exe
11373 credhub_artifact=credhub-windows-2.9.4.tgz
11474 else
11575 install_location=/usr/local/bin
11676 bbl_artifact=bbl-v8.4.110_linux_x86-64
117- bosh_cli_artifact=bosh-cli-7.0.1 -linux-amd64
77+ bosh_cli_artifact=bosh-cli-7.7.2 -linux-amd64
11878 credhub_artifact=credhub-linux-2.9.4.tgz
11979 fi
12080 curl https://github.com/cloudfoundry/bosh-bootloader/releases/download/v8.4.110/${bbl_artifact} --silent --location --output $install_location/bbl
12181 chmod +x $install_location/bbl
12282 bbl --version
12383
124- curl https://s3.amazonaws. com/bosh-cli-artifacts /$bosh_cli_artifact --silent --output $install_location/bosh --location
84+ curl https://github. com/cloudfoundry/ bosh-cli/releases/download/v7.7.2 /$bosh_cli_artifact --silent --output $install_location/bosh --location
12585 chmod +x $install_location/bosh
12686 bosh --version
12787
@@ -134,50 +94,14 @@ jobs:
13494 apt-get update
13595 apt-get install -y build-essential unzip
13696
137- - name : Upload latest CAPI release
138- env :
139- capi_release_version : ${{ vars.CAPI_RELEASE_VERSION }}
140- run : |
141- if [ -z "$capi_release_version" ]
142- then
143- capi_release_version=$(curl -s https://api.github.com/repos/cloudfoundry/capi-release/releases/latest | jq -r .tag_name)
144- fi
145-
146- echo "Latest CAPI release is $capi_release_version"
147-
148- eval "$(bbl print-env --metadata-file metadata.json)"
149- env_name=$(jq -r .name metadata.json)
150- jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${env_name}.priv
151-
152- bosh upload-release "https://bosh.io/d/github.com/cloudfoundry/capi-release?v=$capi_release_version"
153-
154- - name : Deploy Isolation Segment and OIDC Provider
155- run : |
156- env_name=$(jq -r .name metadata.json)
157- jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${env_name}.priv
158- eval "$(bbl print-env --metadata-file metadata.json)"
159-
160- # deploy
161- bosh -d cf manifest > /tmp/manifest.yml
162- bosh interpolate /tmp/manifest.yml \
163- -o cf-deployment/operations/use-internal-lookup-for-route-services.yml \
164- -o cf-deployment/operations/add-persistent-isolation-segment-diego-cell.yml \
165- -o .github/ops-files/use-latest-capi.yml \
166- -o .github/ops-files/add-oidc-provider.yml \
167- -o .github/ops-files/add-uaa-client-credentials.yml \
168- -o .github/ops-files/diego-cell-instances.yml \
169- -v client-secret="${{ secrets.CLIENT_SECRET }}" \
170- > ./director.yml
171-
172- bosh -d cf deploy director.yml -n
173- echo "Deployed CAPI version:"
174- bosh -d cf releases | grep capi
97+ shepherd login service-account ${account_token}
98+ shepherd get lease ${{ inputs.lease-id }} --namespace tas-devex --json | jq .output > metadata.json
17599
176100 - name : Add CATS config
177101 if : ${{ inputs.name == 'cats' }}
178102 run : |
179103 set -eu
180-
104+
181105 ENV=$(jq -r .name metadata.json)
182106 API="$(jq -r .cf.api_url metadata.json)"
183107 DOMAIN=$(echo $API | sed "s/^api\.//")
@@ -284,6 +208,7 @@ jobs:
284208 export GOPATH=$PWD/go
285209 export PATH="$GOPATH/bin:$PATH"
286210 export PATH="$PWD/out:$PATH"
211+ export CF_INT_TEST_NAME="int"
287212
288213 make build
289214
@@ -314,20 +239,12 @@ jobs:
314239 export GOPATH=$PWD/go
315240 export PATH="$GOPATH/bin:$PATH"
316241 export PATH="$PWD/out:$PATH"
242+ export CF_INT_TEST_NAME="cc"
317243
318244 make build
319245
320246 export CF_PASSWORD=${CF_INT_PASSWORD}
321247 cf api ${CF_INT_API} --skip-ssl-validation
322248 cf auth
323249
324- make integration-tests-full-ci
325-
326- - name : Unclaim environment
327- if : ${{ always() && !runner.debug }}
328- env :
329- account_token : ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }}
330- run : |
331- shepherd login service-account ${account_token}
332- set -x
333- shepherd delete lease ${{ steps.claim-env.outputs.lease-id }} --namespace tas-devex
250+ make integration-tests-full-ci
0 commit comments