-
Notifications
You must be signed in to change notification settings - Fork 1.3k
612 lines (585 loc) · 20.9 KB
/
workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
name: CI
on:
pull_request: {}
push:
branches:
- master
tags:
- "*"
# Jobs by event type and dependencies:
# Unit tests for every master/tag push and PR
#
# validate_go_deps
# go_unit_tests
# go_lint
# js_unit_tests
# master/tag push and linkerd org PR: Docker build and integration tests
#
# docker_pull
# docker_build
# kind_setup
# -> kind_integration_host
# -> kind_cleanup
# Forked repository PR: Docker build and integration tests
#
# docker_build
# -> kind_integration_github
# Docker deploy and cloud integration tests for every master/tag push
#
# -> docker_deploy
# -> cloud_integration
# -> cloud_cleanup
jobs:
#
# Unit tests run for:
# - every master push
# - every tag push
# - every PR
#
validate_go_deps:
name: Validate go deps
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
# for debugging
- name: Dump env
run: |
env | sort
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Validate go deps
run: |
. bin/_tag.sh
for f in $( grep -lR --include=Dockerfile\* go-deps: . ) ; do
validate_go_deps_tag $f
done
go_unit_tests:
name: Go unit tests
runs-on: ubuntu-18.04
container:
image: golang:1.13.4
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Go unit tests
env:
GITCOOKIE_SH: ${{ secrets.GITCOOKIE_SH }}
run: |
echo "$GITCOOKIE_SH" | bash
# TODO: validate bin/protoc-go.sh does not dirty the repo
go test -cover -race -v -mod=readonly ./...
go_lint:
name: Go lint
runs-on: ubuntu-18.04
container:
image: golang:1.13.4
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Go lint
env:
GITCOOKIE_SH: ${{ secrets.GITCOOKIE_SH }}
# prevent OOM
GOGC: 20
run: |
echo "$GITCOOKIE_SH" | bash
bin/lint --verbose
go_fmt:
name: Go Format
runs-on: ubuntu-18.04
container:
image: golang:1.13.4
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Format
env:
GITCOOKIE_SH: ${{ secrets.GITCOOKIE_SH }}
run: |
echo "$GITCOOKIE_SH" | bash
bin/fmt
js_unit_tests:
name: JS unit tests
runs-on: ubuntu-18.04
container:
image: node:10.16.0-stretch
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Yarn setup
run: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.21.1 --network-concurrency 1
- name: JS unit tests
run: |
export PATH="$HOME/.yarn/bin:$PATH"
export NODE_ENV=test
bin/web
bin/web test --reporters=jest-dot-reporter
#
# Docker build and kind integration tests run for:
# - every master push
# - every tag push
# - every PR
#
docker_pull:
name: Docker pull
if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Docker SSH setup
run: |
mkdir -p ~/.ssh/
touch ~/.ssh/id && chmod 600 ~/.ssh/id
echo "${{ secrets.DOCKER_SSH_CONFIG }}" > ~/.ssh/config
echo "${{ secrets.DOCKER_PRIVATE_KEY }}" > ~/.ssh/id
echo "${{ secrets.DOCKER_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
ssh linkerd-docker docker version
- name: Docker pull
env:
DOCKER_HOST: ssh://linkerd-docker
run: |
bin/docker pull gcr.io/linkerd-io/proxy-init:v1.3.1
bin/docker pull prom/prometheus:v2.11.1
docker_build:
name: Docker build
runs-on: ubuntu-18.04
env:
IMAGE_ARCHIVES_DIR: /home/runner/archives
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Docker SSH setup
if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork
run: |
mkdir -p ~/.ssh/
touch ~/.ssh/id && chmod 600 ~/.ssh/id
echo "${{ secrets.DOCKER_SSH_CONFIG }}" > ~/.ssh/config
echo "${{ secrets.DOCKER_PRIVATE_KEY }}" > ~/.ssh/id
echo "${{ secrets.DOCKER_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
ssh linkerd-docker docker version
echo ::set-env name=DOCKER_HOST::ssh://linkerd-docker
- name: Build docker images
run: |
export PATH="`pwd`/bin:$PATH"
DOCKER_TRACE=1 bin/docker-build
- name: Create artifact with CLI and image archives
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork
run: |
mkdir -p $IMAGE_ARCHIVES_DIR
cp target/cli/linux/linkerd $IMAGE_ARCHIVES_DIR/
TAG="$(CI_FORCE_CLEAN=1 bin/root-tag)"
for img in controller grafana proxy web ; do
docker save "gcr.io/linkerd-io/$img:$TAG" > $IMAGE_ARCHIVES_DIR/$img.tar
done
# `with.path` values do not support environment variables yet, so an
# absolute path is used here.
#
# https://github.com/actions/upload-artifact/issues/8
- name: Upload artifact
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork
uses: actions/upload-artifact@v1
with:
name: image-archives
path: /home/runner/archives
kind_setup:
strategy:
max-parallel: 3
matrix:
integration_test: [deep, upgrade, helm, helm_upgrade, custom_domain, external_issuer]
name: Cluster setup (${{ matrix.integration_test }})
if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Docker SSH setup
run: |
mkdir -p ~/.ssh/
touch ~/.ssh/id && chmod 600 ~/.ssh/id
echo "${{ secrets.DOCKER_SSH_CONFIG }}" > ~/.ssh/config
echo "${{ secrets.DOCKER_PRIVATE_KEY }}" > ~/.ssh/id
echo "${{ secrets.DOCKER_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
ssh linkerd-docker docker version
- name: Kind cluster setup
env:
DOCKER_HOST: ssh://linkerd-docker
run: |
TAG="$(CI_FORCE_CLEAN=1 bin/root-tag)"
export KIND_CLUSTER=github-$TAG-${{ matrix.integration_test }}
export KUBECONFIG=/tmp/kind-config-$KIND_CLUSTER
export CUSTOM_DOMAIN_CONFIG="test/testdata/custom_cluster_domain_config.yaml"
# retry cluster creation once in case of port conflict or kubeadm failure
if [ "${{ matrix.integration_test }}" == "custom_domain" ]
then
bin/kind create cluster --name=$KIND_CLUSTER --wait=2m --verbosity 3 --config=$CUSTOM_DOMAIN_CONFIG ||
bin/kind create cluster --name=$KIND_CLUSTER --wait=2m --verbosity 3 --config=$CUSTOM_DOMAIN_CONFIG
else
bin/kind create cluster --name=$KIND_CLUSTER --wait=2m --verbosity 3 ||
bin/kind create cluster --name=$KIND_CLUSTER --wait=2m --verbosity 3
fi
#
# Integration tests that run on the docker host are limited by the fact that
# while they all run in separate KinD clusters, they are on the same
# machine. The `strategy` context cannot be conditionally set, so there are
# separate `kind_integration_*` jobs. This allows the `kind_integration_github`
# job to run it's entire matrix in parallel.
#
kind_integration_host:
strategy:
max-parallel: 3
matrix:
integration_test: [deep, upgrade, helm, helm_upgrade, custom_domain, external_issuer]
needs: [docker_pull, docker_build, kind_setup]
name: Host int. tests (${{ matrix.integration_test }})
if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Docker SSH setup
run: |
mkdir -p ~/.ssh/
touch ~/.ssh/id && chmod 600 ~/.ssh/id
echo "${{ secrets.DOCKER_SSH_CONFIG }}" > ~/.ssh/config
echo "${{ secrets.DOCKER_PRIVATE_KEY }}" > ~/.ssh/id
echo "${{ secrets.DOCKER_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
ssh linkerd-docker docker version
- name: Try to load cached Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Kind load docker images
run: |
TAG="$(CI_FORCE_CLEAN=1 bin/root-tag)"
export KIND_CLUSTER=github-$TAG-${{ matrix.integration_test }}
ssh -T linkerd-docker > /dev/null << EOF
# TODO: This is using the kind binary on the remote host.
# TODO: 'kind' still points to v0.5.1. When there are no more old CI branches depending on that
# we can replace it with v0.6.1. In the meantime we explicitly use 'kind-0.6.1'
kind-0.6.1 load docker-image gcr.io/linkerd-io/proxy-init:v1.3.1 --name=$KIND_CLUSTER
kind-0.6.1 load docker-image prom/prometheus:v2.11.1 --name=$KIND_CLUSTER
for IMG in controller grafana proxy web ; do
kind-0.6.1 load docker-image gcr.io/linkerd-io/\$IMG:$TAG --name=$KIND_CLUSTER
done
EOF
- name: Install linkerd CLI
env:
DOCKER_HOST: ssh://linkerd-docker
run: |
TAG="$(CI_FORCE_CLEAN=1 bin/root-tag)"
image="gcr.io/linkerd-io/cli-bin:$TAG"
id=$(bin/docker create $image)
bin/docker cp "$id:/out/linkerd-linux" "$HOME/.linkerd"
$HOME/.linkerd version --client
# validate CLI version matches the repo
[[ "$TAG" == "$($HOME/.linkerd version --short --client)" ]]
echo "Installed Linkerd CLI version: $TAG"
- name: Run integration tests
env:
DOCKER_HOST: ssh://linkerd-docker
GITCOOKIE_SH: ${{ secrets.GITCOOKIE_SH }}
run: |
export PATH="`pwd`/bin:$PATH"
echo "$GITCOOKIE_SH" | bash
# TODO: pin Go version
go version
TAG="$(CI_FORCE_CLEAN=1 bin/root-tag)"
export KIND_CLUSTER=github-$TAG-${{ matrix.integration_test }}
# Restore kubeconfig from remote docker host.
mkdir -p $HOME/.kube
export KUBECONFIG=$HOME/.kube/kind-config-$KIND_CLUSTER
bin/kind export kubeconfig --name=$KIND_CLUSTER --kubeconfig $KUBECONFIG
# Start ssh tunnel to allow kubectl to connect via localhost.
export KIND_PORT=$(bin/kubectl config view -o jsonpath="{.clusters[?(@.name=='kind-$KIND_CLUSTER')].cluster.server}" | cut -d':' -f3)
echo "KIND_PORT: $KIND_PORT"
ssh -4 -N -L $KIND_PORT:localhost:$KIND_PORT linkerd-docker &
sleep 2 # Wait for ssh tunnel to come up.
bin/kubectl version --short # Test connection to kind cluster.
(
. bin/_test-run.sh
init_test_run $HOME/.linkerd
${{ matrix.integration_test }}_integration_tests
)
kind_integration_github:
strategy:
matrix:
integration_test: [deep, upgrade, helm, helm_upgrade, custom_domain, external_issuer]
needs: [docker_build]
name: GitHub int. tests (${{ matrix.integration_test }})
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download image archives
uses: actions/download-artifact@v1
with:
name: image-archives
- name: Try to load cached Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup KinD (default)
if: matrix.integration_test != 'custom_domain'
uses: engineerd/setup-kind@v0.3.0
with:
version: "v0.6.1"
- name: Setup KinD (custom_domain)
if: matrix.integration_test == 'custom_domain'
uses: engineerd/setup-kind@v0.3.0
with:
config: test/testdata/custom_cluster_domain_config.yaml
version: "v0.6.1"
- name: Load image archives into KinD
run: |
for img in controller grafana proxy web; do
kind load image-archive image-archives/$img.tar
done
- name: Install linkerd CLI
run: |
cp image-archives/linkerd $HOME/.linkerd
chmod +x $HOME/.linkerd
- name: Run integration tests
run: |
. bin/_test-run.sh
init_test_run $HOME/.linkerd
${{ matrix.integration_test }}_integration_tests
kind_cleanup:
strategy:
fail-fast: false # always attempt to cleanup all clusters
matrix:
integration_test: [deep, upgrade, helm, helm_upgrade, custom_domain, external_issuer]
needs: [kind_integration_host]
name: Cluster cleanup (${{ matrix.integration_test }})
if: always() && (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork)
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
# for debugging
- name: Dump env
run: |
env | sort
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Docker SSH setup
run: |
mkdir -p ~/.ssh/
touch ~/.ssh/id && chmod 600 ~/.ssh/id
echo "${{ secrets.DOCKER_SSH_CONFIG }}" > ~/.ssh/config
echo "${{ secrets.DOCKER_PRIVATE_KEY }}" > ~/.ssh/id
echo "${{ secrets.DOCKER_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
ssh linkerd-docker docker version
- name: Kind cluster cleanup
env:
DOCKER_HOST: ssh://linkerd-docker
run: |
TAG="$(CI_FORCE_CLEAN=1 bin/root-tag)"
export KIND_CLUSTER=github-$TAG-${{ matrix.integration_test }}
bin/kind delete cluster --name=$KIND_CLUSTER
#
# Docker deploy and cloud integration tests run for:
# - every master push
# - every tag push
#
docker_deploy:
name: Docker deploy
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-18.04
needs: [validate_go_deps, go_unit_tests, go_lint, js_unit_tests, kind_integration_host, kind_cleanup]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Configure gcloud
env:
CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
CLOUD_SDK_SERVICE_ACCOUNT_KEY: ${{ secrets.CLOUD_SDK_SERVICE_ACCOUNT_KEY }}
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
GCP_ZONE: ${{ secrets.GCP_ZONE }}
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }}
run: |
# Install gcloud and kubectl.
echo "$CLOUD_SDK_SERVICE_ACCOUNT_KEY" > .gcp.json
dir="${CLOUDSDK_INSTALL_DIR:-${HOME}}/google-cloud-sdk"
(
. bin/_gcp.sh ;
install_gcloud "$dir"
gcloud components install kubectl
# Configure gcloud with a service account.
set_gcloud_config "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER"
# Get a kubernetes context.
get_k8s_ctx "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER"
)
. "$dir/path.bash.inc"
gcloud auth configure-docker
bin/kubectl version --short
- name: Docker SSH setup
run: |
mkdir -p ~/.ssh/
touch ~/.ssh/id && chmod 600 ~/.ssh/id
echo "${{ secrets.DOCKER_SSH_CONFIG }}" > ~/.ssh/config
echo "${{ secrets.DOCKER_PRIVATE_KEY }}" > ~/.ssh/id
echo "${{ secrets.DOCKER_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
ssh linkerd-docker docker version
- name: Docker push
env:
DOCKER_HOST: ssh://linkerd-docker
run: |
export PATH="`pwd`/bin:$PATH"
TAG="$(CI_FORCE_CLEAN=1 bin/root-tag)"
bin/docker-push-deps
bin/docker-push $TAG
bin/docker-retag-all $TAG master
bin/docker-push master
cloud_integration:
name: Cloud integration tests
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-18.04
needs: [docker_deploy]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Configure gcloud
env:
CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
CLOUD_SDK_SERVICE_ACCOUNT_KEY: ${{ secrets.CLOUD_SDK_SERVICE_ACCOUNT_KEY }}
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
GCP_ZONE: ${{ secrets.GCP_ZONE }}
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }}
run: |
# Install gcloud and kubectl.
echo "$CLOUD_SDK_SERVICE_ACCOUNT_KEY" > .gcp.json
dir="${CLOUDSDK_INSTALL_DIR:-${HOME}}/google-cloud-sdk"
(
. bin/_gcp.sh ;
install_gcloud "$dir"
gcloud components install kubectl
# Configure gcloud with a service account.
set_gcloud_config "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER"
# Get a kubernetes context.
get_k8s_ctx "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER"
)
. "$dir/path.bash.inc"
gcloud auth configure-docker
bin/kubectl version --short
- name: Install linkerd CLI
run: |
TAG="$(CI_FORCE_CLEAN=1 bin/root-tag)"
image="gcr.io/linkerd-io/cli-bin:$TAG"
id=$(bin/docker create $image)
bin/docker cp "$id:/out/linkerd-linux" "$HOME/.linkerd"
$HOME/.linkerd version --client
# validate CLI version matches the repo
[[ "$TAG" == "$($HOME/.linkerd version --short --client)" ]]
echo "Installed Linkerd CLI version: $TAG"
- name: Run integration tests
env:
GITCOOKIE_SH: ${{ secrets.GITCOOKIE_SH }}
run: |
export PATH="`pwd`/bin:$PATH"
echo "$GITCOOKIE_SH" | bash
version="$($HOME/.linkerd version --client --short | tr -cd '[:alnum:]-')"
bin/test-run $HOME/.linkerd linkerd-$version
- name: CNI tests
run: |
export TAG="$($HOME/.linkerd version --client --short)"
go test -cover -race -v -mod=readonly ./cni-plugin/test -integration-tests
cloud_cleanup:
if: always() && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags'))
name: Cloud cleanup
runs-on: ubuntu-18.04
needs: [cloud_integration]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Configure gcloud
env:
CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
CLOUD_SDK_SERVICE_ACCOUNT_KEY: ${{ secrets.CLOUD_SDK_SERVICE_ACCOUNT_KEY }}
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
GCP_ZONE: ${{ secrets.GCP_ZONE }}
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }}
run: |
# Install gcloud and kubectl.
echo "$CLOUD_SDK_SERVICE_ACCOUNT_KEY" > .gcp.json
dir="${CLOUDSDK_INSTALL_DIR:-${HOME}}/google-cloud-sdk"
(. bin/_gcp.sh ;
install_gcloud "$dir"
gcloud components install kubectl
# Configure gcloud with a service account.
set_gcloud_config "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER"
# Get a kubernetes context.
get_k8s_ctx "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER"
)
. "$dir/path.bash.inc"
gcloud auth configure-docker
bin/kubectl version --short
- name: Cleanup
run: |
export PATH="`pwd`/bin:$PATH"
bin/test-cleanup
#
# Helm chart artifact deploy run for:
# - every tag push
#
chart_deploy:
name: Helm chart deploy
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-18.04
needs: [cloud_integration]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Configure gsutils
env:
CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
CLOUD_SDK_SERVICE_ACCOUNT_KEY: ${{ secrets.LINKERD_SITE_TOKEN }}
GCP_PROJECT: ${{ secrets.LINKERD_SITE_PROJECT }}
GCP_ZONE: ${{ secrets.LINKERD_SITE_ZONE }}
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }}
run: |
# Install gcloud and gsutil.
echo "$CLOUD_SDK_SERVICE_ACCOUNT_KEY" > .gcp.json
dir="${CLOUDSDK_INSTALL_DIR:-${HOME}}/google-cloud-sdk"
(
. bin/_gcp.sh ;
install_gcloud "$dir"
gcloud components install gsutil
# Configure gcloud with a service account.
set_gcloud_config "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER"
)
. "$dir/path.bash.inc"
mkdir -p target/helm
- name: Edge Helm chart creation and upload
if: startsWith(github.ref, 'refs/tags/edge')
run: |
gsutil cp gs://helm.linkerd.io/edge/index.yaml target/helm/index-pre.yaml
bin/helm-build package
gsutil rsync target/helm gs://helm.linkerd.io/edge
- name: Stable Helm chart creation and upload
if: startsWith(github.ref, 'refs/tags/stable')
run: |
gsutil cp gs://helm.linkerd.io/stable/index.yaml target/helm/index-pre.yaml
bin/helm-build package
gsutil rsync target/helm gs://helm.linkerd.io/stable