forked from cockroachdb/cockroach-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWORKSPACE
138 lines (104 loc) · 4.39 KB
/
WORKSPACE
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
# gazelle:repository_macro hack/build/repos.bzl%go_repositories
workspace(name = "com_github_coachroachdb_cockroach_operator")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
http_archive(
name = "com_google_protobuf",
sha256 = "2ee9dcec820352671eb83e081295ba43f7a4157181dad549024d7070d079cf65",
strip_prefix = "protobuf-3.9.0",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.9.0.tar.gz"],
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
## Load rules_go and dependencies
http_archive(
name = "io_bazel_rules_go",
sha256 = "a8d6b1b354d371a646d2f7927319974e0f9e52f73a2452d2b3877118169eb6bb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.3/rules_go-v0.23.3.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.23.3/rules_go-v0.23.3.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(
go_version = "1.14.4",
# todo nogo is failing
# nogo = "@//hack/build:nogo_vet",
)
## Load gazelle and dependencies
http_archive(
name = "bazel_gazelle",
url = "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.1/bazel-gazelle-v0.19.1.tar.gz",
sha256 = "86c6d481b3f7aedc1d60c1c211c6f76da282ae197c3b3160f54bd3a8f847896f",
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
## Load kubernetes repo-infra for tools like kazel
http_archive(
name = "io_k8s_repo_infra",
strip_prefix = "repo-infra-0.0.2",
sha256 = "774e160ba1a2a66a736fdc39636dca799a09df015ac5e770a46ec43487ec5708",
urls = [
"https://github.com/kubernetes/repo-infra/archive/v0.0.2.tar.gz",
],
)
## Load rules_docker and dependencies, for working with docker images
http_archive(
name = "io_bazel_rules_docker",
sha256 = "4521794f0fba2e20f3bf15846ab5e01d5332e587e9ce81629c7f96c793bb7036",
strip_prefix = "rules_docker-0.14.4",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.14.4/rules_docker-v0.14.4.tar.gz"],
)
load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")
container_deps()
load("@io_bazel_rules_docker//repositories:pip_repositories.bzl", "pip_deps")
pip_deps()
load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
load("@io_bazel_rules_docker//go:image.bzl", _go_image_repos = "repositories")
_go_image_repos()
container_pull(
name = "redhat_ubi_minimal",
registry = "registry.access.redhat.com",
repository = "ubi8/ubi-minimal",
tag = "latest",
)
# Load and define targets defined in //hack/bin
load("//hack/bin:deps.bzl", install_hack_bin = "install")
install_hack_bin()
load("//hack/build:repos.bzl", "go_repositories")
go_repositories()
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# This requires rules_docker to be fully instantiated before
# it is pulled in.
# Download the rules_k8s repository at release v0.4
http_archive(
name = "io_bazel_rules_k8s",
sha256 = "d91aeb17bbc619e649f8d32b65d9a8327e5404f451be196990e13f5b7e2d17bb",
strip_prefix = "rules_k8s-0.4",
urls = ["https://github.com/bazelbuild/rules_k8s/releases/download/v0.4/rules_k8s-v0.4.tar.gz"],
)
load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_repositories")
k8s_repositories()
load("@io_bazel_rules_k8s//k8s:k8s_go_deps.bzl", k8s_go_deps = "deps")
k8s_go_deps()
load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_defaults")
# Setting up the defaults for rules k8s. The varible values
# are replaced by hack/build/print-workspace-status.sh
k8s_defaults(
# This becomes the name of the @repository and the rule
# you will import in your BUILD files.
name = "k8s_deploy",
kind = "deployment",
# This is the name of the cluster as it appears in:
# kubectl config view --minify -o=jsonpath='{.contexts[0].context.cluster}'
# You are able to override the default cluster by setting the env variable K8S_CLUSTER
cluster = "{CLUSTER}",
# You are able to override the default registry by setting the env variable IMAGE_REGISTRY
image_chroot = "{IMAGE_REGISTRY}",
)