forked from refractionPOINT/usp-adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild_release.yaml
88 lines (88 loc) · 3.19 KB
/
cloudbuild_release.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
steps:
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
id: get-github-keys
args: ['-c', 'echo $$SSH_KEY > /workspace/id_rsa']
secretEnv: ['SSH_KEY']
- name: 'gcr.io/cloud-builders/docker'
id: build-docker
entrypoint: 'bash'
args: ['-c', 'docker build -f ./containers/general/Dockerfile -t refractionpoint/lc-adapter:$TAG_NAME -t gcr.io/$PROJECT_ID/github.com/refractionpoint/usp-adapters/lc-adapter:$TAG_NAME -t refractionpoint/lc-adapter:latest .']
waitFor: ['get-github-keys']
- name: 'golang'
id: build-linux64
args: ['go', 'build', '-v', '-o', 'lc_adapter_linux_64_$TAG_NAME', './containers/general']
waitFor: ['get-github-keys']
- name: 'golang'
id: build-win64
args: ['go', 'build', '-v', '-o', 'lc_adapter_windows_64_$TAG_NAME.exe', './containers/general']
env:
- 'GOOS=windows'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang'
id: build-macos64
args: ['go', 'build', '-v', '-o', 'lc_adapter_macos_64_$TAG_NAME', './containers/general']
env:
- 'GOOS=darwin'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang'
id: build-macosarm64
args: ['go', 'build', '-v', '-o', 'lc_adapter_macos_arm64_$TAG_NAME', './containers/general']
env:
- 'GOOS=darwin'
- 'GOARCH=arm64'
waitFor: ['get-github-keys']
- name: 'golang'
id: build-linuxarm
args: ['go', 'build', '-v', '-o', 'lc_adapter_linux_arm_$TAG_NAME', './containers/general']
env:
- 'GOOS=linux'
- 'GOARCH=arm'
- 'GOARM=5'
waitFor: ['get-github-keys']
- name: 'golang'
id: build-linuxarm64
args: ['go', 'build', '-v', '-o', 'lc_adapter_linux_arm64_$TAG_NAME', './containers/general']
env:
- 'GOOS=linux'
- 'GOARCH=arm64'
waitFor: ['get-github-keys']
- name: 'golang'
id: build-solarisamd64
args: ['go', 'build', '-v', '-o', 'lc_adapter_solaris_amd64_$TAG_NAME', './containers/general']
env:
- 'GOOS=solaris'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang'
id: build-aixppc64
args: ['go', 'build', '-v', '-o', 'lc_adapter_aix_ppc64_$TAG_NAME', './containers/general']
env:
- 'GOOS=aix'
- 'GOARCH=ppc64'
waitFor: ['get-github-keys']
- name: 'gcr.io/cloud-builders/gsutil'
id: copy-binary-adapters
args: ['cp', './lc_adapter_*', 'gs://limacharlie-io/installers/']
waitFor: ['build-linux64', 'build-win64', 'build-macos64', 'build-macosarm64', 'build-linuxarm', 'build-linuxarm64', 'build-solarisamd64', 'build-aixppc64']
- name: 'gcr.io/cloud-builders/docker'
id: copy-docker-adapter
entrypoint: 'bash'
args: ['-c', 'docker login --username=$$USERNAME --password=$$PASSWORD && docker push refractionpoint/lc-adapter:$TAG_NAME && docker push refractionpoint/lc-adapter:latest']
secretEnv: ['USERNAME', 'PASSWORD']
waitFor: ['build-docker']
images:
- gcr.io/$PROJECT_ID/github.com/refractionpoint/usp-adapters/lc-adapter:$TAG_NAME
availableSecrets:
secretManager:
- versionName: projects/${PROJECT_ID}/secrets/DOCKERHUB/versions/latest
env: 'PASSWORD'
- versionName: projects/${PROJECT_ID}/secrets/DOCKERHUB_USERNAME/versions/latest
env: 'USERNAME'
- versionName: projects/${PROJECT_ID}/secrets/GITHUB-DEPS-ACCESS/versions/latest
env: 'SSH_KEY'
options:
machineType: 'N1_HIGHCPU_8'
timeout: 15m