-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathtests.cloudbuild.yaml
39 lines (39 loc) · 1.11 KB
/
tests.cloudbuild.yaml
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
steps:
- id: "e2e-test"
waitFor: ["-"]
name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
dir: "${_SAMPLE_DIR}"
script: |
#!/bin/bash
echo "Run e2e-test ..."
./tests/e2e-test.sh || touch /workspace/e2e-failed
env:
- "BUILD_ID=$BUILD_ID"
- "_REGION=$_REGION"
- "_SERVICE_NAME=$_SERVICE_NAME"
- id: "e2e-cleanup"
waitFor: ["e2e-test"]
name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
dir: "${_SAMPLE_DIR}"
script: |
#!/bin/bash
export MC_SERVICE_NAME="${_SERVICE_NAME}-$BUILD_ID"
gcloud run services delete "${MC_SERVICE_NAME}" --quiet --region "${_REGION}"
env:
- "BUILD_ID=$BUILD_ID"
- "_REGION=$_REGION"
- "_SERVICE_NAME=$_SERVICE_NAME"
- id: "report-status"
waitFor: ["e2e-cleanup"]
name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
script: |
#!/bin/bash
if [[ -f /workspace/e2e-failed ]]
then
echo "Step e2e-test failed"
exit 1
fi
substitutions:
_SERVICE_NAME: "nginx-mc-example-testing"
_REGION: "us-central1"
_SAMPLE_DIR: "multi-container/hello-nginx-sample"