forked from sapcc/mosquitto-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
executable file
·49 lines (45 loc) · 1.3 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
timeout: '18000s'
options:
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
steps:
- id: INIT-BUILDX_BUILDER
name: gcr.io/cloud-builders/docker
entrypoint: 'bash'
args:
- -c
- |
docker run --privileged gcr.io/teknoir/binfmt-qemu:v0.8-v7.0.0
docker buildx create --name mybuilder --use
docker buildx inspect --bootstrap
waitFor: ['-']
- id: BUILD-AND-PUSH-VERSIONED
name: gcr.io/cloud-builders/docker
entrypoint: 'bash'
args:
- -c
- |
set -eo pipefail
docker buildx build \
--platform=linux/arm/v7,linux/arm64/v8,linux/amd64 \
--push \
--label "git-commit=${SHORT_SHA}" \
--tag gcr.io/${PROJECT_ID}/mosquitto-exporter:${BRANCH_NAME}-${SHORT_SHA} \
.
waitFor: ['INIT-BUILDX_BUILDER']
- id: BUILD-AND-PUSH-LATEST
name: gcr.io/cloud-builders/docker
entrypoint: 'bash'
args:
- -c
- |
set -eo pipefail
if [ ${BRANCH_NAME} == 'master' ]; then
docker buildx build \
--platform=linux/arm/v7,linux/arm64/v8,linux/amd64 \
--push \
--label "git-commit=${SHORT_SHA}" \
--tag gcr.io/${PROJECT_ID}/mosquitto-exporter:latest \
.
fi
waitFor: ['BUILD-AND-PUSH-VERSIONED']