2023-05-25 12:43:44 -04:00
|
|
|
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
2023-08-10 03:45:46 -04:00
|
|
|
load("//bazel/go:go_test.bzl", "go_test")
|
2023-08-23 10:39:49 -04:00
|
|
|
load("//bazel/sh:def.bzl", "sh_template")
|
2023-05-25 12:43:44 -04:00
|
|
|
|
|
|
|
go_library(
|
|
|
|
name = "configapi_lib",
|
2023-08-10 03:45:46 -04:00
|
|
|
srcs = [
|
|
|
|
"delete.go",
|
2023-08-10 03:46:34 -04:00
|
|
|
"main.go",
|
2023-08-10 03:45:46 -04:00
|
|
|
],
|
2023-05-25 12:43:44 -04:00
|
|
|
importpath = "github.com/edgelesssys/constellation/v2/hack/configapi",
|
|
|
|
visibility = ["//visibility:private"],
|
2023-08-10 03:45:46 -04:00
|
|
|
deps = [
|
|
|
|
"//internal/api/attestationconfigapi",
|
2023-08-23 10:39:49 -04:00
|
|
|
"//internal/constants",
|
2023-08-10 03:45:46 -04:00
|
|
|
"//internal/logger",
|
|
|
|
"//internal/staticupload",
|
|
|
|
"@com_github_spf13_cobra//:cobra",
|
|
|
|
"@org_uber_go_zap//:zap",
|
|
|
|
],
|
2023-05-25 12:43:44 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
go_binary(
|
2023-08-09 12:58:46 -04:00
|
|
|
name = "configapi",
|
2023-05-25 12:43:44 -04:00
|
|
|
embed = [":configapi_lib"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2023-08-10 03:45:46 -04:00
|
|
|
|
|
|
|
go_test(
|
|
|
|
name = "configapi_test",
|
|
|
|
srcs = [
|
|
|
|
"delete_test.go",
|
2023-08-10 03:46:34 -04:00
|
|
|
"main_test.go",
|
2023-08-10 03:45:46 -04:00
|
|
|
],
|
|
|
|
embed = [":configapi_lib"],
|
|
|
|
deps = [
|
|
|
|
"//internal/api/attestationconfigapi",
|
|
|
|
"@com_github_stretchr_testify//assert",
|
|
|
|
"@com_github_stretchr_testify//require",
|
|
|
|
],
|
|
|
|
)
|
2023-08-23 10:39:49 -04:00
|
|
|
|
|
|
|
sh_template(
|
|
|
|
name = "configapi_e2e_test",
|
|
|
|
data = [":configapi"],
|
|
|
|
substitutions = {
|
|
|
|
"@@CONFIGAPI_CLI@@": "$(rootpath :configapi)",
|
|
|
|
},
|
|
|
|
template = "e2e/test.sh.in",
|
|
|
|
)
|