-
Notifications
You must be signed in to change notification settings - Fork 312
/
cloudbuild.yaml
33 lines (33 loc) · 1.15 KB
/
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
# See https://cloud.google.com/cloud-build/docs/build-config
options:
dynamic_substitutions: true
substitution_option: ALLOW_LOOSE
machineType: 'N1_HIGHCPU_8'
steps:
- name: gcr.io/cloud-builders/git
args: ['fetch', '--tags']
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20221214-1b4dd4d69a'
entrypoint: /buildx-entrypoint
args:
- build
- --tag=gcr.io/$PROJECT_ID/cloud-controller-manager:$_SHORT_TAG
- --tag=gcr.io/$PROJECT_ID/cloud-controller-manager:latest
- --build-arg=VERSION=$_SHORT_TAG
- --output=type=registry
- --platform=linux/amd64,linux/arm64
- .
# Build cloudbuild artifacts (for attestation)
- name: 'docker.io/library/golang:1.23.0-bookworm'
id: cloudbuild-artifacts
entrypoint: make
env:
- PULL_BASE_REF=$_PULL_BASE_REF
- LATEST_FILE=markers/${_PULL_BASE_REF}/latest-tag.txt
args:
- cloudbuild-artifacts
substitutions:
_GIT_TAG: 'v99999999-v12345'
# Remove date prefix (first 10 characters) to create valid semver version:
# v20220510-v1.24.0-alpha.0-15-g09bd268 => v1.24.0-alpha.0-15-g09bd268
_SHORT_TAG: '${_GIT_TAG:10}'
timeout: 1200s