-
Notifications
You must be signed in to change notification settings - Fork 3
/
BUILD.bazel
63 lines (53 loc) · 1.67 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
load("@bazel_gazelle//:def.bzl", "gazelle")
gazelle(
name = "gazelle",
prefix = "kubevirt.io/cluster-api-provider-external",
)
load("@io_bazel_rules_docker//contrib:passwd.bzl", "passwd_entry", "passwd_file")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
passwd_entry(
name = "nonroot_user",
home = "/home/non-root",
shell = "/bin/bash",
uid = 1001,
gid = 1001,
username = "non-root",
)
passwd_file(
name = "passwd",
entries = [
":nonroot_user",
],
)
pkg_tar(
name = "passwd_tar",
srcs = [":passwd"],
mode = "0644",
package_dir = "etc",
visibility = ["//visibility:public"],
)
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_bundle",
container_repositories = "repositories",
)
config_setting(
name = "release",
values = {"define": "release=true"},
)
container_bundle(
name = "cluster_api_provider_external_images",
images = {
"index.docker.io/kubevirt/cluster-api-provider-external:$(container_tag)": "//cmd/external-controller:cluster_api_provider_external_image",
"index.docker.io/kubevirt/fence-provision-manager:$(container_tag)": "//cmd/fence-provision-manager:fence_provision_manager_image",
},
)
load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
docker_push(
name = "push_images",
bundle = select({
"//cluster/k8s-1.11.0:cluster_provider_k8s_1_11_0": "//cluster/k8s-1.11.0:cluster_api_provider_external_images",
"//cluster/os-3.10.0:cluster_provider_os_3_10_0": "//cluster/os-3.10.0:cluster_api_provider_external_images",
":release": ":cluster_api_provider_external_images",
}),
)