-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathtests.cloudbuild.yaml
48 lines (48 loc) · 1.41 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
40
41
42
43
44
45
46
47
48
steps:
- id: "unit-test"
name: "gcr.io/cloud-builders/docker:latest"
dir: "${_SAMPLE_DIR}"
entrypoint: "./tests/unit-test.sh"
- id: "e2e-test"
waitFor: ["-"]
name: "gcr.io/google.com/cloudsdktool/cloud-sdk:$_CLOUDSDK_VERSION"
dir: "${_SAMPLE_DIR}"
script: |
#!/bin/bash
./tests/e2e-test.sh || touch /workspace/e2e-failed
env:
- "BUILD_ID=$BUILD_ID"
- "SHORT_SHA=$SHORT_SHA"
- "PROJECT_ID=$PROJECT_ID"
- "_REGION=$_REGION"
- "_IMAGE_NAME=$_IMAGE_NAME"
- id: "e2e-cleanup"
waitFor: ["e2e-test"]
name: "gcr.io/google.com/cloudsdktool/cloud-sdk:$_CLOUDSDK_VERSION"
dir: "${_SAMPLE_DIR}"
entrypoint: "./tests/e2e-cleanup.sh"
env:
- "BUILD_ID=$BUILD_ID"
- "PROJECT_ID=$PROJECT_ID"
- "_REGION=$_REGION"
- "_IMAGE_NAME=$_IMAGE_NAME"
- id: "report-status"
waitFor: ["e2e-cleanup"]
name: "gcr.io/google.com/cloudsdktool/cloud-sdk:$_CLOUDSDK_VERSION"
dir: "${_SAMPLE_DIR}"
script: |
#!/bin/bash
if [[ -f /workspace/e2e-failed ]]
then
echo "Step e2e-test failed"
exit 1
fi
substitutions:
_REGION: "europe-west9"
_AR_REPO_REGION: "us-central1"
_AR_REPO_NAME: "samples"
_IMAGE_NAME: "${_AR_REPO_REGION}-docker.pkg.dev/${PROJECT_ID}/${_AR_REPO_NAME}/jobs-shell:${SHORT_SHA}"
_SAMPLE_DIR: "jobs-shell"
_CLOUDSDK_VERSION: "latest"
options:
dynamicSubstitutions: true