forked from kubernetes-sigs/kernel-module-management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
124 lines (120 loc) · 4.24 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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
steps:
- id: build-manager-image
name: gcr.io/cloud-builders/docker
args:
- build
- --build-arg
- TARGET=manager
- --tag=gcr.io/$PROJECT_ID/kernel-module-management-operator:$_GIT_TAG
- --tag=gcr.io/$PROJECT_ID/kernel-module-management-operator:latest
- .
waitFor: ['-']
- id: push-manager-image
name: gcr.io/cloud-builders/docker
args:
- push
- --all-tags
- gcr.io/$PROJECT_ID/kernel-module-management-operator
waitFor: [build-manager-image]
- id: build-manager-hub-image
name: gcr.io/cloud-builders/docker
args:
- build
- --build-arg
- TARGET=manager-hub
- --tag=gcr.io/$PROJECT_ID/kernel-module-management-operator-hub:$_GIT_TAG
- --tag=gcr.io/$PROJECT_ID/kernel-module-management-operator-hub:latest
- .
waitFor: ['-']
- id: push-manager-hub-image
name: gcr.io/cloud-builders/docker
args:
- push
- --all-tags
- gcr.io/$PROJECT_ID/kernel-module-management-operator-hub
waitFor: [build-manager-hub-image]
- id: build-signimage
name: gcr.io/cloud-builders/docker
args:
- build
- --tag=gcr.io/$PROJECT_ID/kernel-module-management-signimage:$_GIT_TAG
- --tag=gcr.io/$PROJECT_ID/kernel-module-management-signimage:latest
- --file=Dockerfile.signimage
- .
waitFor: ['-']
- id: push-signimage
name: gcr.io/cloud-builders/docker
args:
- push
- --all-tags
- gcr.io/$PROJECT_ID/kernel-module-management-signimage
waitFor: [build-signimage]
- id: build-bundles
name: golang:1.19-alpine3.17
env:
- '_GIT_TAG=$_GIT_TAG'
- 'PROJECT_ID=$PROJECT_ID'
entrypoint: sh
args:
- -eEuo
- pipefail
- -c
- |-
set -euxo pipefail
apk add bash curl gcc make musl-dev
# Install kubectl
curl -Lo /usr/local/bin/kubectl "https://dl.k8s.io/release/$$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x /usr/local/bin/kubectl
# Include the destination directory of `go install` in $$PATH
export PATH=$$(go env GOPATH)/bin:$${PATH}
# KMM
make bundle IMG=gcr.io/$PROJECT_ID/kernel-module-management-operator:$_GIT_TAG USE_IMAGE_DIGESTS=true
mv bundle bundle.Dockerfile /bundle-kmm
# KMM Hub
make bundle-hub HUB_IMG=gcr.io/$PROJECT_ID/kernel-module-management-operator-hub:$_GIT_TAG USE_IMAGE_DIGESTS=true
mv bundle bundle.Dockerfile /bundle-hub
volumes:
- name: bundle-kmm
path: /bundle-kmm
- name: bundle-hub
path: /bundle-hub
waitFor: [push-manager-image, build-manager-hub-image, push-signimage]
- id: build-kmm-bundle-image
name: gcr.io/cloud-builders/docker
args:
- build
- --file=bundle.Dockerfile
- --cache-from=gcr.io/$PROJECT_ID/kernel-module-management-operator-bundle:latest
- --tag=gcr.io/$PROJECT_ID/kernel-module-management-operator-bundle:$_GIT_TAG
- --tag=gcr.io/$PROJECT_ID/kernel-module-management-operator-bundle:latest
- .
dir: /bundle-kmm
volumes:
- name: bundle-kmm
path: /bundle-kmm
waitFor: [build-bundles]
- id: build-hub-bundle-image
name: gcr.io/cloud-builders/docker
args:
- build
- --file=bundle.Dockerfile
- --cache-from=gcr.io/$PROJECT_ID/kernel-module-management-operator-hub-bundle:latest
- --tag=gcr.io/$PROJECT_ID/kernel-module-management-operator-hub-bundle:$_GIT_TAG
- --tag=gcr.io/$PROJECT_ID/kernel-module-management-operator-hub-bundle:latest
- .
dir: /bundle-hub
volumes:
- name: bundle-hub
path: /bundle-hub
waitFor: [build-bundles]
# this prevents errors if you don't use both _GIT_TAG and _PULL_BASE_REF,
# or any new substitutions added in the future.
options:
substitution_option: ALLOW_LOOSE
images:
# Binary images pushed manually in steps so that they are available in build-bundles,
# which looks for their SHA on their registry.
- gcr.io/$PROJECT_ID/kernel-module-management-operator-bundle:$_GIT_TAG
- gcr.io/$PROJECT_ID/kernel-module-management-operator-bundle:latest
- gcr.io/$PROJECT_ID/kernel-module-management-operator-hub-bundle:$_GIT_TAG
- gcr.io/$PROJECT_ID/kernel-module-management-operator-hub-bundle:latest