-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
114 lines (98 loc) · 4.49 KB
/
MODULE.bazel
File metadata and controls
114 lines (98 loc) · 4.49 KB
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
# The MIT License (MIT)
#
# Copyright © 2025 linuxdaemon <linuxdaemon.irc@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
"""Bazel module for the apply-retention-policy tool."""
module(name = "apply-retention-policy")
bazel_dep(name = "aspect_bazel_lib", version = "2.22.0")
bazel_dep(name = "rules_go", version = "0.59.0")
bazel_dep(name = "gazelle", version = "0.47.0")
bazel_dep(name = "rules_oci", version = "2.2.7")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.1.1", dev_dependency = True)
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "golangci_lint_linux_amd64",
build_file_content = """
exports_files(["golangci-lint"])
""",
patch_cmds = ["cp golangci-lint-*/golangci-lint golangci-lint"],
sha256 = "ce46a1f1d890e7b667259f70bb236297f5cf8791a9b6b98b41b283d93b5b6e88",
urls = ["https://github.com/golangci/golangci-lint/releases/download/v2.7.2/golangci-lint-2.7.2-linux-amd64.tar.gz"],
)
http_archive(
name = "golangci_lint_linux_arm64",
build_file_content = """
exports_files(["golangci-lint"])
""",
patch_cmds = ["cp golangci-lint-*/golangci-lint golangci-lint"],
sha256 = "7028e810837722683dab679fb121336cfa303fecff39dfe248e3e36bc18d941b",
urls = ["https://github.com/golangci/golangci-lint/releases/download/v2.7.2/golangci-lint-2.7.2-linux-arm64.tar.gz"],
)
http_archive(
name = "golangci_lint_darwin_amd64",
build_file_content = """
exports_files(["golangci-lint"])
""",
patch_cmds = ["cp golangci-lint-*/golangci-lint golangci-lint"],
sha256 = "6966554840a02229a14c52641bc38c2c7a14d396f4c59ba0c7c8bb0675ca25c9",
urls = ["https://github.com/golangci/golangci-lint/releases/download/v2.7.2/golangci-lint-2.7.2-darwin-amd64.tar.gz"],
)
http_archive(
name = "golangci_lint_darwin_arm64",
build_file_content = """
exports_files(["golangci-lint"])
""",
patch_cmds = ["cp golangci-lint-*/golangci-lint golangci-lint"],
sha256 = "6ce86a00e22b3709f7b994838659c322fdc9eae09e263db50439ad4f6ec5785c",
urls = ["https://github.com/golangci/golangci-lint/releases/download/v2.7.2/golangci-lint-2.7.2-darwin-arm64.tar.gz"],
)
http_archive(
name = "golangci_lint_windows_amd64",
build_file_content = """
exports_files(["golangci-lint.exe"])
""",
patch_cmds = ["cp golangci-lint-*/golangci-lint.exe golangci-lint.exe"],
sha256 = "d48f456944c5850ca408feb0cac186345f0a6d8cf5dc31875c8f63d3dff5ee4c",
urls = ["https://github.com/golangci/golangci-lint/releases/download/v2.7.2/golangci-lint-2.7.2-windows-amd64.zip"],
)
http_archive(
name = "golangci_lint_windows_arm64",
build_file_content = """
exports_files(["golangci-lint.exe"])
""",
patch_cmds = ["cp golangci-lint-*/golangci-lint.exe golangci-lint.exe"],
sha256 = "e5fc39e0f3fe817f093b5467bfc60d2a9d1292de930b29322d2a1f8aff2a3bbf",
urls = ["https://github.com/golangci/golangci-lint/releases/download/v2.7.2/golangci-lint-2.7.2-windows-arm64.zip"],
)
# Register Go toolchain
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.from_file(go_mod = "//:go.mod")
# Register Go dependencies
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(go_deps, "com_github_spf13_cobra", "com_github_spf13_viper", "com_github_stretchr_testify", "org_golang_x_sys", "org_uber_go_zap")
# Register distroless images and make them available
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "distroless_base",
digest = "sha256:f5a3067027c2b322cd71b844f3d84ad3deada45ceb8a30f301260a602455070e",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64/v8",
],
)
use_repo(oci, "distroless_base", "distroless_base_linux_amd64", "distroless_base_linux_arm64_v8")
zstd = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")
zstd.zstd()
use_repo(zstd, "zstd_toolchains")
register_toolchains("@zstd_toolchains//:all")