19
19
name :
20
20
required : true
21
21
type : string
22
- pool-name :
23
- type : string
24
- default : ${{ vars.SHEPHERD_POOL_NAME }}
25
- pool-namespace :
22
+ lease-id :
23
+ required : true
26
24
type : string
27
- default : ' official'
28
25
gitRef :
29
26
type : string
30
27
default : ${{github.event.workflow_run.head_sha}}
@@ -50,78 +47,41 @@ jobs:
50
47
ref : release-candidate
51
48
path : cf-acceptance-tests
52
49
53
- - name : Checkout cf-deployment
54
- uses : actions/checkout@v4
55
- with :
56
- repository : cloudfoundry/cf-deployment
57
- path : cf-deployment
58
-
59
50
- name : Checkout CF deployment tasks
60
51
uses : actions/checkout@v4
61
52
with :
62
53
repository : cloudfoundry/cf-deployment-concourse-tasks
63
54
path : cf-deployment-concourse-tasks
64
55
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
-
98
56
- name : Set Up Go
99
57
uses : actions/setup-go@v5
100
58
with :
101
59
go-version-file : go.mod
102
60
check-latest : true
103
61
104
62
- name : Install Tools
63
+ env :
64
+ account_token : ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }}
105
65
run : |
106
66
go version
107
67
108
68
if [[ ${{ inputs.os }} =~ "windows" ]]
109
69
then
110
70
install_location=/usr/bin
111
71
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
113
73
credhub_artifact=credhub-windows-2.9.4.tgz
114
74
else
115
75
install_location=/usr/local/bin
116
76
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
118
78
credhub_artifact=credhub-linux-2.9.4.tgz
119
79
fi
120
80
curl https://github.com/cloudfoundry/bosh-bootloader/releases/download/v8.4.110/${bbl_artifact} --silent --location --output $install_location/bbl
121
81
chmod +x $install_location/bbl
122
82
bbl --version
123
83
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
125
85
chmod +x $install_location/bosh
126
86
bosh --version
127
87
@@ -134,50 +94,14 @@ jobs:
134
94
apt-get update
135
95
apt-get install -y build-essential unzip
136
96
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
175
99
176
100
- name : Add CATS config
177
101
if : ${{ inputs.name == 'cats' }}
178
102
run : |
179
103
set -eu
180
-
104
+
181
105
ENV=$(jq -r .name metadata.json)
182
106
API="$(jq -r .cf.api_url metadata.json)"
183
107
DOMAIN=$(echo $API | sed "s/^api\.//")
@@ -284,6 +208,7 @@ jobs:
284
208
export GOPATH=$PWD/go
285
209
export PATH="$GOPATH/bin:$PATH"
286
210
export PATH="$PWD/out:$PATH"
211
+ export CF_INT_TEST_NAME="int"
287
212
288
213
make build
289
214
@@ -314,20 +239,12 @@ jobs:
314
239
export GOPATH=$PWD/go
315
240
export PATH="$GOPATH/bin:$PATH"
316
241
export PATH="$PWD/out:$PATH"
242
+ export CF_INT_TEST_NAME="cc"
317
243
318
244
make build
319
245
320
246
export CF_PASSWORD=${CF_INT_PASSWORD}
321
247
cf api ${CF_INT_API} --skip-ssl-validation
322
248
cf auth
323
249
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