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}}
31
-
32
28
jobs :
33
29
run-integration-tests :
34
30
defaults :
@@ -42,92 +38,41 @@ jobs:
42
38
with :
43
39
ref : ${{inputs.gitRef}}
44
40
45
- - name : Checkout cli-ci
46
- uses : actions/checkout@v4
47
- with :
48
- repository : cloudfoundry/cli-ci
49
- path : cli-ci
50
-
51
- - id : read-min-capi
52
- name : Read MIN CAPI
53
- run : |
54
- wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq &&\
55
- chmod +x /usr/bin/yq
56
- version=$(yq '.capi-version-min' build_data.yml)
57
- echo "version=$version" >> $GITHUB_OUTPUT
58
-
59
- - name : Checkout cf-deployment Min CAPI
60
- if : ${{ inputs.capi-version != 'edge' }}
61
- uses : actions/checkout@v4
62
- with :
63
- repository : cloudfoundry/cf-deployment
64
- path : cf-deployment
65
- ref : ${{ steps.read-min-capi.outputs.version }}
66
-
67
- - name : Checkout cf-deployment
68
- uses : actions/checkout@v4
69
- with :
70
- repository : cloudfoundry/cf-deployment
71
- path : cf-deployment
72
-
73
41
- name : Checkout CF deployment tasks
74
42
uses : actions/checkout@v4
75
43
with :
76
44
repository : cloudfoundry/cf-deployment-concourse-tasks
77
45
path : cf-deployment-concourse-tasks
78
46
79
- - id : claim-env
80
- name : Claim Environment
47
+ - name : Set Up Go
48
+ uses : actions/setup-go@v5
49
+ with :
50
+ go-version-file : go.mod
51
+ check-latest : true
52
+
53
+ - name : Install Tools
81
54
env :
82
55
account_token : ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }}
83
- pool_name : ${{ inputs.pool-name }}
84
- pool_namespace : ${{ inputs.pool-namespace }}
85
56
run : |
86
- shepherd login service-account ${account_token}
87
-
88
- echo "shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace ${pool_namespace} --namespace tas-devex --description 'CLI GHA'"
89
- lease_id=$(shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace ${pool_namespace} --namespace tas-devex --json | jq -r .id)
90
- # Give sometime for the lease to complete. Shepherd may take upto an 3 hours to create an env
91
- # if the pool is empty.
92
- count=0
93
- while [ $count -lt 360 ] ; do
94
- sleep 30
95
- status=$(shepherd get lease ${lease_id} --namespace tas-devex --json | jq -r .status)
96
- if [ $status == "LEASED" ] ; then
97
- shepherd get lease ${lease_id} --namespace tas-devex --json | jq .output > metadata.json
98
- break
99
- elif [ $status == "FAILED" -o $status == "EXPIRED" ] ; then
100
- echo "There was an error obtaining the lease. Lease status is ${status}."
101
- exit 1
102
- else
103
- echo "Waiting for environment to be ready. Lease status is ${status}."
104
- fi
105
- count=$(($count+1))
106
- done
107
-
108
- env_name=$(jq -r .name metadata.json)
109
- cat metadata.json | jq -r '.name'
110
- echo "lease-id=$lease_id" >> "${GITHUB_OUTPUT}"
57
+ go version
111
58
112
- - name : Install Tools
113
- run : |
114
59
if [[ ${{ inputs.os }} =~ "windows" ]]
115
60
then
116
61
install_location=/usr/bin
117
62
bbl_artifact=bbl-v8.4.110_windows.exe
118
- bosh_cli_artifact=bosh-cli-7.0.1 -windows-amd64.exe
63
+ bosh_cli_artifact=bosh-cli-7.7.2 -windows-amd64.exe
119
64
credhub_artifact=credhub-windows-2.9.4.tgz
120
65
else
121
66
install_location=/usr/local/bin
122
67
bbl_artifact=bbl-v8.4.110_linux_x86-64
123
- bosh_cli_artifact=bosh-cli-7.0.1 -linux-amd64
68
+ bosh_cli_artifact=bosh-cli-7.7.2 -linux-amd64
124
69
credhub_artifact=credhub-linux-2.9.4.tgz
125
70
fi
126
71
curl https://github.com/cloudfoundry/bosh-bootloader/releases/download/v8.4.110/${bbl_artifact} --silent --location --output $install_location/bbl
127
72
chmod +x $install_location/bbl
128
73
bbl --version
129
74
130
- curl https://s3.amazonaws. com/bosh-cli-artifacts /$bosh_cli_artifact --silent --output $install_location/bosh --location
75
+ curl https://github. com/cloudfoundry/ bosh-cli/releases/download/v7.7.2 /$bosh_cli_artifact --silent --output $install_location/bosh --location
131
76
chmod +x $install_location/bosh
132
77
bosh --version
133
78
@@ -138,51 +83,10 @@ jobs:
138
83
credhub --version
139
84
140
85
apt-get update
141
- apt-get install -y build-essential
86
+ apt-get install -y build-essential unzip
142
87
143
- - name : Upload latest CAPI release
144
- env :
145
- capi_release_version : ${{ vars.CAPI_RELEASE_VERSION }}
146
- run : |
147
- if [ -z "$capi_release_version" ]
148
- then
149
- capi_release_version=$(curl -s https://api.github.com/repos/cloudfoundry/capi-release/releases/latest | jq -r .tag_name)
150
- fi
151
-
152
- echo "Latest CAPI release is $capi_release_version"
153
-
154
- eval "$(bbl print-env --metadata-file metadata.json)"
155
- env_name=$(jq -r .name metadata.json)
156
- jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${env_name}.priv
157
- bosh upload-release "https://bosh.io/d/github.com/cloudfoundry/capi-release?v=$capi_release_version"
158
-
159
- - name : Deploy Isolation Segment and OIDC Provider
160
- run : |
161
- env_name=$(jq -r .name metadata.json)
162
- jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${env_name}.priv
163
- eval "$(bbl print-env --metadata-file metadata.json)"
164
-
165
- # deploy
166
- bosh -d cf manifest > /tmp/manifest.yml
167
- bosh interpolate /tmp/manifest.yml \
168
- -o cf-deployment/operations/use-internal-lookup-for-route-services.yml \
169
- -o cf-deployment/operations/add-persistent-isolation-segment-diego-cell.yml \
170
- -o .github/ops-files/use-latest-capi.yml \
171
- -o .github/ops-files/add-oidc-provider.yml \
172
- -o .github/ops-files/add-uaa-client-credentials.yml \
173
- -o .github/ops-files/diego-cell-instances.yml \
174
- -v client-secret="${{ secrets.CLIENT_SECRET }}" \
175
- > ./director.yml
176
-
177
- bosh -d cf deploy director.yml -n
178
- echo "Deployed CAPI version:"
179
- bosh -d cf releases | grep capi
180
-
181
- - name : Set Up Go
182
- uses : actions/setup-go@v5
183
- with :
184
- go-version-file : go.mod
185
- check-latest : true
88
+ shepherd login service-account ${account_token}
89
+ shepherd get lease ${{ inputs.lease-id }} --namespace tas-devex --json | jq .output > metadata.json
186
90
187
91
- name : Run Integration Tests
188
92
if : ${{ !inputs.run-with-client-creds }}
@@ -202,6 +106,7 @@ jobs:
202
106
export GOPATH=$PWD/go
203
107
export PATH="$GOPATH/bin:$PATH"
204
108
export PATH="$PWD/out:$PATH"
109
+ export CF_INT_TEST_NAME="int"
205
110
206
111
make build
207
112
@@ -232,6 +137,7 @@ jobs:
232
137
export GOPATH=$PWD/go
233
138
export PATH="$GOPATH/bin:$PATH"
234
139
export PATH="$PWD/out:$PATH"
140
+ export CF_INT_TEST_NAME="cc"
235
141
236
142
make build
237
143
@@ -240,12 +146,3 @@ jobs:
240
146
cf auth
241
147
242
148
make integration-tests-full-ci
243
-
244
- - name : Unclaim environment
245
- if : always()
246
- env :
247
- account_token : ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }}
248
- run : |
249
- shepherd login service-account ${account_token}
250
- set -x
251
- shepherd delete lease ${{ steps.claim-env.outputs.lease-id }} --namespace tas-devex
0 commit comments