forked from kubevirt/containerized-data-importer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
232 lines (204 loc) · 8.42 KB
/
BUILD.bazel
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
load("@bazeldnf//:def.bzl", "bazeldnf")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
py_runtime(
name = "python2_runtime",
interpreter_path = "/usr/bin/python2",
python_version = "PY2",
)
py_runtime(
name = "python3_runtime",
interpreter_path = "/usr/bin/python3",
python_version = "PY3",
)
py_runtime_pair(
name = "python_runtimes",
py2_runtime = ":python2_runtime",
py3_runtime = ":python3_runtime",
)
toolchain(
name = "python_toolchain",
toolchain = ":python_runtimes",
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
)
# gazelle:prefix kubevirt.io/containerized-data-importer
gazelle(name = "gazelle")
bazeldnf(name = "bazeldnf")
go_library(
name = "go_default_library",
srcs = ["doc.go"],
importpath = "kubevirt.io/containerized-data-importer",
visibility = ["//visibility:public"],
)
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_bundle",
"container_image",
"container_push",
)
container_bundle(
name = "test-container-images-amd64",
images = {
"$(container_prefix)/cdi-func-test-bad-webserver:$(container_tag)": "//tools/cdi-func-test-bad-webserver:cdi-func-test-bad-webserver-image",
"$(container_prefix)/cdi-func-test-proxy:$(container_tag)": "//tools/cdi-func-test-proxy:cdi-func-test-proxy-image",
"$(container_prefix)/cdi-func-test-sample-populator:$(container_tag)": "//tools/cdi-func-test-sample-populator:cdi-func-test-sample-populator-image",
"$(container_prefix)/cdi-func-test-file-host-init:$(container_tag)": "//tools/cdi-func-test-file-host-init:cdi-func-test-file-host-init-image",
"$(container_prefix)/cdi-func-test-file-host-http:$(container_tag)": "//tools/cdi-func-test-file-host-init:cdi-func-test-file-host-http-image",
"$(container_prefix)/cdi-func-test-registry-init:$(container_tag)": "//tools/cdi-func-test-registry-init:cdi-func-test-registry-init-image",
"$(container_prefix)/cdi-func-test-registry-populate:$(container_tag)": "//tools/cdi-func-test-registry-init:cdi-func-test-registry-populate-image",
"$(container_prefix)/cdi-func-test-registry:$(container_tag)": "//tools/cdi-func-test-registry-init:cdi-func-test-registry-image",
"$(container_prefix)/imageio-init:$(container_tag)": "//tools/imageio-init:imageio-init-image",
"$(container_prefix)/vcenter-simulator:$(container_tag)": "//tools/vddk-test:vcenter-simulator",
"$(container_prefix)/vddk-init:$(container_tag)": "//tools/vddk-init:vddk-init-image",
"$(container_prefix)/vddk-test:$(container_tag)": "//tools/vddk-test:vddk-test-image",
"$(container_prefix)/cdi-func-test-tinycore:$(container_tag)": "//tests:cdi-func-test-tinycore",
"$(container_prefix)/cdi-func-test-imageio:$(container_tag)": "//tools/image-io:cdi-func-test-imageio-image",
},
)
container_bundle(
name = "test-container-images-aarch64",
images = {
"$(container_prefix)/cdi-func-test-bad-webserver:$(container_tag)": "//tools/cdi-func-test-bad-webserver:cdi-func-test-bad-webserver-image",
"$(container_prefix)/cdi-func-test-proxy:$(container_tag)": "//tools/cdi-func-test-proxy:cdi-func-test-proxy-image",
"$(container_prefix)/cdi-func-test-sample-populator:$(container_tag)": "//tools/cdi-func-test-sample-populator:cdi-func-test-sample-populator-image",
"$(container_prefix)/cdi-func-test-file-host-init:$(container_tag)": "//tools/cdi-func-test-file-host-init:cdi-func-test-file-host-init-image",
"$(container_prefix)/cdi-func-test-file-host-http:$(container_tag)": "//tools/cdi-func-test-file-host-init:cdi-func-test-file-host-http-image",
"$(container_prefix)/cdi-func-test-registry-init:$(container_tag)": "//tools/cdi-func-test-registry-init:cdi-func-test-registry-init-image",
"$(container_prefix)/cdi-func-test-registry-populate:$(container_tag)": "//tools/cdi-func-test-registry-init:cdi-func-test-registry-populate-image",
"$(container_prefix)/cdi-func-test-registry:$(container_tag)": "//tools/cdi-func-test-registry-init:cdi-func-test-registry-image",
"$(container_prefix)/imageio-init:$(container_tag)": "//tools/imageio-init:imageio-init-image",
"$(container_prefix)/vcenter-simulator:$(container_tag)": "//tools/vddk-test:vcenter-simulator",
"$(container_prefix)/cdi-func-test-tinycore:$(container_tag)": "//tests:cdi-func-test-tinycore",
"$(container_prefix)/cdi-func-test-imageio:$(container_tag)": "//tools/image-io:cdi-func-test-imageio-image",
},
)
load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
alias(
name = "test-container-images",
actual = select({
"@io_bazel_rules_go//go/platform:linux_arm64":":test-container-images-aarch64",
"//conditions:default": ":test-container-images-amd64",
})
)
docker_push(
name = "push-test-images",
bundle = ":test-container-images",
)
container_push(
name = "push-cdi-operator",
format = "Docker",
image = "//cmd/cdi-operator:cdi-operator-image",
registry = "$(container_prefix)",
repository = "cdi-operator",
tag = "$(container_tag)",
)
container_push(
name = "push-cdi-controller",
format = "Docker",
image = "//cmd/cdi-controller:cdi-controller-image",
registry = "$(container_prefix)",
repository = "cdi-controller",
tag = "$(container_tag)",
)
container_push(
name = "push-cdi-apiserver",
format = "Docker",
image = "//cmd/cdi-apiserver:cdi-apiserver-image",
registry = "$(container_prefix)",
repository = "cdi-apiserver",
tag = "$(container_tag)",
)
container_push(
name = "push-cdi-cloner",
format = "Docker",
image = "//cmd/cdi-cloner:cdi-cloner-image",
registry = "$(container_prefix)",
repository = "cdi-cloner",
tag = "$(container_tag)",
)
container_push(
name = "push-cdi-importer",
format = "Docker",
image = "//cmd/cdi-importer:cdi-importer-image",
registry = "$(container_prefix)",
repository = "cdi-importer",
tag = "$(container_tag)",
)
container_push(
name = "push-cdi-uploadproxy",
format = "Docker",
image = "//cmd/cdi-uploadproxy:cdi-uploadproxy-image",
registry = "$(container_prefix)",
repository = "cdi-uploadproxy",
tag = "$(container_tag)",
)
container_push(
name = "push-cdi-uploadserver",
format = "Docker",
image = "//cmd/cdi-uploadserver:cdi-uploadserver-image",
registry = "$(container_prefix)",
repository = "cdi-uploadserver",
tag = "$(container_tag)",
)
filegroup(
name = "test-images",
srcs = [
"//tests:images/tinyCore.iso",
"//tests:images/tinyCore.vdi",
"//tests:images/archive.tar",
"//tests:images/cirros-qcow2.img",
"//tests:images/cirros.raw",
"//tests:images/cirros-large-virtual-size.raw.xz",
"//tests:images/cirros-large-virtual-size.qcow2",
"//tests:images/cirros-large-physical-size.raw.xz",
"//tests:images/cirros-large-physical-size.qcow2",
"//tests:images/cirros-snapshot1.qcow2",
"//tests:images/cirros-snapshot2.qcow2",
],
visibility = ["//visibility:public"],
)
filegroup(
name = "test-invalid-images",
srcs = [
"//tests:images/invalid_qcow_images/invalid-qcow-large-memory.img",
],
visibility = ["//visibility:public"],
)
container_image(
name = "testimage_base",
tars = select({
"@io_bazel_rules_go//go/platform:linux_arm64": [
"//rpm:testimage_aarch64",
],
"//conditions:default": [
"//rpm:testimage_x86_64",
],
}),
visibility = ["//visibility:public"],
)
container_image(
name = "centos_base",
tars = select({
"@io_bazel_rules_go//go/platform:linux_arm64": [
"//rpm:centos_base_aarch64",
],
"//conditions:default": [
"//rpm:centos_base_x86_64",
],
}),
visibility = ["//visibility:public"],
)
genrule(
name = "ca_anchors",
outs = ["tls-ca-bundle.pem"],
cmd = "/usr/bin/p11-kit extract --format=pem-bundle --filter=ca-anchors --overwrite --comment --purpose server-auth $@",
)
pkg_tar(
name = "ca_anchors_tar",
srcs = [":ca_anchors"],
package_dir = "/etc/pki/ca-trust/extracted/pem",
visibility = ["//visibility:public"],
)