-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcloudbuild.yaml
43 lines (43 loc) · 1.88 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
steps:
- name: 'gcr.io/cloud-builders/docker:20.10.3'
args: ['run', '--privileged', 'linuxkit/binfmt:v0.7']
id: 'initialize-qemu'
- name: 'gcr.io/cloud-builders/docker:20.10.3'
args: ['buildx', 'create', '--name', 'mybuilder']
id: 'create-builder'
- name: 'gcr.io/cloud-builders/docker:20.10.3'
args: ['buildx', 'use', 'mybuilder']
id: 'select-builder'
- name: 'gcr.io/cloud-builders/docker:20.10.3'
args: ['buildx', 'inspect', '--bootstrap']
id: 'show-target-build-platforms'
- name: 'gcr.io/cloud-builders/docker:20.10.3'
entrypoint: "/bin/bash"
secretEnv: ["LINEAR_AIRBYTE_KEY"]
args:
- "-c"
- "-eEuo"
- "pipefail"
- |
apt-get update
apt-get install -qq -y gettext
envsubst < test_files/config_template.json > test_files/config.json
docker buildx build --platform=linux/amd64 -t linear-airbyte-source --load -f Dockerfile .
docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp -v $(pwd):/test_input airbyte/source-acceptance-test:latest --acceptance-test-config /test_input
id: integration-test
- name: 'gcr.io/cloud-builders/docker:20.10.3'
entrypoint: "/bin/bash"
args:
- "-c"
- |
[[ "$BRANCH_NAME" == "main" ]] && docker buildx build --platform=$_DOCKER_BUILDX_PLATFORMS -t gcr.io/${PROJECT_ID}/linear-airbyte-source:$BUILD_ID -t gcr.io/${PROJECT_ID}/linear-airbyte-source:latest --push -f Dockerfile . || docker buildx build --platform=$_DOCKER_BUILDX_PLATFORMS -t gcr.io/${PROJECT_ID}/linear-airbyte-source:$BUILD_ID -t gcr.io/${PROJECT_ID}/linear-airbyte-source:latest -f Dockerfile .
id: build-multi-architecture-container-image
options:
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
substitutions:
_DOCKER_BUILDX_PLATFORMS: 'linux/amd64,linux/arm64'
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/linear_airbyte_key/versions/latest
env: "LINEAR_AIRBYTE_KEY"