"//utils/hostname",
"//utils/log",
"//utils/subst",
- "@com_github_thalesignite_crypto11//:crypto11",
"@com_github_keybase_go_keychain//:go-keychain",
+ "@com_github_thalesignite_crypto11//:crypto11",
"@in_gopkg_yaml_v3//:yaml_v3",
],
)
"//cmd/prometheus_http_discovery:prometheus_http_discovery_systemd_service",
],
)
+
+nfpm_package(
+ name = "coredns",
+ config = ":coredns.yaml",
+ data = [
+ "//thirdparty/coredns",
+ ],
+)
--- /dev/null
+name: "${const:ExePrefix}coredns"
+arch: "amd64"
+platform: "linux"
+version: "${sub:${const:Version},+unset,}"
+section: "net"
+priority: "extra"
+maintainer: "Bazel Build Service <bazelbuild@${const:RootDomain}>"
+depends:
+ - ${const:ExePrefix}runtime-utils
+description: |
+ Custom CoreDNS build.
+vendor: "${const:OrgName}"
+homepage: "https://go.fuhry.dev/runtime"
+license: "Proprietary"
+contents: []
\ No newline at end of file
dedup := hashset.NewHashSet[string]()
for _, dir := range bazelBinDirs {
- if dirEntries, err := os.ReadDir(path.Join(wd, dir, "cmd")); err == nil {
- entries = append(entries, dirEntries...)
+ for _, subdir := range []string{"cmd", "thirdparty"} {
+ if dirEntries, err := os.ReadDir(path.Join(wd, dir, subdir)); err == nil {
+ entries = append(entries, dirEntries...)
+ }
}
}
-load("//bazel:go.bzl", "go_multi_binary", "go_multi_library")
load("//bazel:cross.bzl", "go_cross_binaries")
+load("//bazel:go.bzl", "go_multi_binary", "go_multi_library")
load("//bazel:subst.bzl", "subst")
+load("//bazel:svc.bzl", "systemd_service")
subst(
name = "plugin_cfg",
base_target = "coredns",
linux_arm = True,
openbsd = True,
-)
\ No newline at end of file
+)
+
+systemd_service(
+ name = "coredns@",
+ args = [
+ "-conf=/etc/coredns/Corefile.%i",
+ "-pidfile=/run/coredns.%i.pid",
+ "-mtls.config=${const:SystemConfDir}/mtls-files-only.yaml",
+ "-etcd.srv-domain=${const:DefaultHostDomain}",
+ "-etcd.startup-timeout=1000",
+ "-mtls.id=etcd-client",
+ ],
+ description = "in-house build of coredns with special plugins - instance %i",
+ exe = "coredns",
+ group = "root",
+ type = "simple",
+ user = "root",
+)
srcs = ["generate.go"],
importpath = "go.fuhry.dev/runtime/thirdparty/coredns/plugin",
)
+
go_multi_binary(
name = "generate",
embed = [":generate_lib"],
gotags = ["generate"],
visibility = ["//thirdparty/coredns:__subpackages__"],
)
+
genrule(
name = "zplugin_go",
- outs = ["zplugin.go"],
srcs = [
"//thirdparty/coredns:plugin_cfg",
],
+ outs = ["zplugin.go"],
+ cmd = """
+ ./$(location :generate) -plugin-cfg "$<" > "$@"
+ """,
tools = [
":generate",
],
- cmd = """
- ./$(location :generate) -plugin-cfg "$<" > "$@"
- """
)
go_multi_library(