-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
146 lines (123 loc) · 4.16 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
package(default_visibility = ["//visibility:public"])
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")
load("@io_bazel_rules_docker//lang:image.bzl", container_image = "app_layer")
# grpc message
proto_library(
name = "addressbook_proto",
srcs = [
"src/main/proto/addressbook.proto",
]
)
proto_library(
name = "greeter_proto",
srcs = [
"src/main/proto/greeter.proto",
],
deps = [
":addressbook_proto",
]
)
java_proto_library(
name = "addressbook_proto_java",
deps = [
":addressbook_proto",
]
)
java_proto_library(
name = "greeter_proto_java",
deps = [
":greeter_proto",
],
)
java_grpc_library(
name = "greeter_java_grpc",
srcs = [
":greeter_proto",
],
deps = [
":greeter_proto_java",
],
)
# library
filegroup(
name = "srcs",
srcs = glob(["src/main/java/**/grnd/constants/*.java"]) +
glob(["src/main/java/**/grnd/controller/*.java"]) +
glob(["src/main/java/**/grnd/entity/*.java"]) +
glob(["src/main/java/**/grnd/entity/engine/*.java"]) +
glob(["src/main/java/**/grnd/exception/*.java"]) +
glob(["src/main/java/**/grnd/service/*.java"]) +
glob(["src/main/java/**/grnd/util/*.java"]) +
glob(["src/main/java/**/grnd/*.java"])
)
java_library(
name = "augmentation-backend-library",
srcs = [
":srcs",
],
resources = glob(["src/main/resources/**/*"]),
deps = [
":addressbook_proto_java",
":greeter_proto_java",
":greeter_java_grpc",
"@io_grpc_grpc_java//api",
"@io_grpc_grpc_java//stub",
"@maven//:org_springframework_boot_spring_boot_starter_web",
"@maven//:com_google_code_gson_gson",
"@maven//:com_squareup_okhttp3_okhttp",
"@maven//:io_kubernetes_client_java_extended",
"@maven//:io_kubernetes_client_java",
"@maven//:io_kubernetes_client_java_api",
"@maven//:io_kubernetes_client_java_api_fluent",
"@maven//:org_springframework_boot_spring_boot",
"@maven//:org_springframework_boot_spring_boot_autoconfigure",
"@maven//:org_springframework_spring_beans",
"@maven//:org_springframework_spring_context",
"@maven//:org_springframework_spring_core",
"@maven//:org_springframework_spring_web",
"@maven//:org_apache_tomcat_annotations_api",
"@maven//:javax_servlet_servlet_api",
"@maven//:org_yaml_snakeyaml",
"@maven//:org_slf4j_slf4j_api",
],
)
# host
java_binary(
name = "augmentation-backend-app",
srcs = glob(["src/main/java/**/grnd/GovernmentRnDDemoApplication.java"]),
resources = glob(["src/main/resources/**/*"]),
deps = [
":augmentation-backend-library",
":addressbook_proto_java",
":greeter_proto_java",
":greeter_java_grpc",
"@io_grpc_grpc_java//api",
"@io_grpc_grpc_java//stub",
"@maven//:org_springframework_boot_spring_boot_starter_web",
"@maven//:com_google_code_gson_gson",
"@maven//:com_squareup_okhttp3_okhttp",
"@maven//:io_kubernetes_client_java_extended",
"@maven//:io_kubernetes_client_java",
"@maven//:io_kubernetes_client_java_api",
"@maven//:io_kubernetes_client_java_api_fluent",
"@maven//:org_springframework_boot_spring_boot",
"@maven//:org_springframework_boot_spring_boot_autoconfigure",
"@maven//:org_springframework_spring_beans",
"@maven//:org_springframework_spring_context",
"@maven//:org_springframework_spring_core",
"@maven//:org_springframework_spring_web",
"@maven//:org_apache_tomcat_annotations_api",
"@maven//:javax_servlet_servlet_api",
"@maven//:org_yaml_snakeyaml",
"@maven//:org_slf4j_slf4j_api",
],
main_class = "com.nexr.de.grnd.GovernmentRnDDemoApplication",
)
# docker image
container_image(
name="augmentation-backend-image",
base="@augmentation-backend-base//image",
binary=":augmentation-backend-app",
docker_run_flags="-it --rm --network=host --runtime=nvidia"
)