-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMODULE.bazel
71 lines (61 loc) · 2.31 KB
/
MODULE.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
module(
name = "full_example",
version = "0.0.0",
)
bazel_dep(
name = "tweag-credential-helper",
version = "0.0.0",
)
local_path_override(
module_name = "tweag-credential-helper",
path = "../..",
)
bazel_dep(name = "rules_oci", version = "2.2.2")
single_version_override(
module_name = "rules_oci",
patch_strip = 1,
patches = ["//:rules_oci.patch"],
)
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
http_file(
name = "private_github_repo_file",
integrity = "sha256-geRViD7FxlM37de9EEW0/qUP7wk7QGNtlqqAAevVSRA=",
urls = ["https://raw.githubusercontent.com/tweag/credential-helper-private/606312d9f8467ed4368cf8b126b95c161ba5de28/hello.txt"],
)
http_file(
name = "hello_world_s3",
integrity = "sha256-PPMlDTQUjT/gPEqOsaOGlblp/5bsa/zl+fVEJ5+ypd8=",
urls = ["https://malte-s3-bazel-test.s3.amazonaws.com/hello_world"],
)
http_file(
name = "hello_world_r2",
integrity = "sha256-30vzSs1zKPpvC2kT3MVrRQtoiKVicYyL+XDpuWhRFPU=",
urls = ["https://47ffb5f0a156e14a0985028c836501e2.r2.cloudflarestorage.com/r2-private-example/hello_world"],
)
http_file(
name = "hello_world_gcs",
integrity = "sha256-/Llq5Bi4Y+uTiDqUzDn4FUXP35fiDSku0b2PeKFTztw=",
urls = ["https://storage.googleapis.com/rules_gcs/hello_world"],
)
# temporarily removed until CI has required access
# http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# http_archive(
# name = "private_github_repo",
# build_file_content = """exports_files(glob(["**"]))""",
# integrity = "sha256-/M5gC3mcEjAUvQtByW3jYMWnwR7eD3NTs7ZWUp2QcAI=",
# strip_prefix = "credential-helper-private-0.0.1",
# urls = ["https://github.com/tweag/credential-helper-private/archive/refs/tags/v0.0.1.tar.gz"],
# )
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "ghcr_oci",
digest = "sha256:2d4e459f4ecb5329407ae3e47cbc107a2fbace221354ca75960af4c047b3cb13",
image = "ghcr.io/tweag/credential-helper-private-image",
)
oci.pull(
name = "docker_hub_hello_world",
digest = "sha256:5b3cc85e16e3058003c13b7821318369dad01dac3dbb877aac3c28182255c724",
image = "hello-world",
platforms = ["linux/amd64"],
)
use_repo(oci, "docker_hub_hello_world", "docker_hub_hello_world_linux_amd64", "ghcr_oci")