-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
87 lines (79 loc) · 2.58 KB
/
BUILD.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
load("@gazelle//:def.bzl", "gazelle")
load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load", "oci_push")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
# gazelle:prefix github.com/bentekkie/bentekkie-mainframe
# gazelle:exclude **/*.pb.go
# gazelle:exclude **/*.connect.go
# gazelle:resolve go github.com/bentekkie/bentekkie-mainframe/proto/command/v1 //proto/command/v1:commandv1_go_proto
# gazelle:resolve go github.com/bentekkie/bentekkie-mainframe/proto/command/v1/commandv1connect //proto/command/v1/commandv1connect:commandv1_connect_go_proto
gazelle(name = "gazelle")
go_library(
name = "bentekkie-mainframe_lib",
srcs = ["main.go"],
importpath = "github.com/bentekkie/bentekkie-mainframe",
visibility = ["//visibility:private"],
deps = [
"//server",
"//server/db",
"//server/env",
"@com_github_joho_godotenv//:godotenv",
"@com_github_lib_pq//:pq",
"@com_github_sirupsen_logrus//:logrus",
],
)
go_binary(
name = "bentekkie-mainframe",
embed = [":bentekkie-mainframe_lib"],
pure = "on",
visibility = ["//visibility:public"],
)
# Include it in our base image as a tar.
oci_image(
name = "bentekkie-mainframe_image",
base = "@distroless_base_linux_amd64",
entrypoint = ["/bentekkie-mainframe"],
tars = [
":bentekkie-mainframe_server_tar",
"//clientnext:clientnext_export_tar",
],
user = "nonroot",
)
# Include it in our base image as a tar.
oci_load(
name = "bentekkie-mainframe_image_tarball",
image = ":bentekkie-mainframe_image",
repo_tags = ["bentekkie-mainframe:latest"],
)
oci_push(
name = "bentekkie-mainframe_image_push",
image = ":bentekkie-mainframe_image",
remote_tags = ["latest"],
repository = "ghcr.io/bentekkie/bentekkie-mainframe",
)
pkg_tar(
name = "bentekkie-mainframe_server_tar",
srcs = [":bentekkie-mainframe"],
include_runfiles = True,
visibility = ["//visibility:public"],
)
go_test(
name = "bentekkie-mainframe_test",
srcs = [
"bentekkie_mainframe_suite_test.go",
"command_test.go",
"page_open_test.go",
],
deps = [
"//server",
"//server/db",
"//server/env",
"@com_github_joho_godotenv//:godotenv",
"@com_github_onsi_ginkgo//:ginkgo",
"@com_github_onsi_gomega//:gomega",
"@com_github_ory_dockertest_v3//:dockertest",
"@com_github_sclevine_agouti//:agouti",
"@com_github_sclevine_agouti//matchers",
"@com_github_sirupsen_logrus//:logrus",
],
)