forked from cyralinc/terraform-provider-cyral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
36 lines (32 loc) · 970 Bytes
/
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
steps:
# Run docker linter
- name: "hadolint/hadolint:v2.5.0"
args:
- hadolint
- Dockerfile
id: "docker-lint"
# Generate terraform version
- name: "gcr.io/cloud-builders/gsutil"
entrypoint: "bash"
args:
- "-c"
- |
# tag=$(git tag --sort v:refname | tail -n1 | sed 's/v//g') # Cloudbuild does not upload .git directory
tag=0.0.1
commitID=${SHORT_SHA:-dirty}
version="$tag+$commitID"
echo $version > /workspace/version.txt
env:
- "SHORT_SHA=$SHORT_SHA"
id: "generate-terraform-version"
# Build container image
- name: "gcr.io/cloud-builders/docker"
entrypoint: "bash"
args:
- "-c"
- |
docker build --build-arg VERSION=$(cat /workspace/version.txt) --tag=gcr.io/$PROJECT_ID/cyral-terraform-provider:$BUILD_ID .
id: "docker-build"
timeout: 1800s
# List of artifacts
images: ["gcr.io/$PROJECT_ID/cyral-terraform-provider:$BUILD_ID"]