blob: 0e911418bfe7a3397a03a18d8cdfb47dcefe9c99 [file] [log] [blame]
Sergiusz Bazanski6f773e02019-10-02 20:46:48 +02001load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push")
Sergiusz Bazanski325e9472019-09-27 02:49:47 +02002load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
3
4go_library(
5 name = "go_default_library",
6 srcs = [
7 "dispatcher.go",
8 "main.go",
9 "twilio.go",
10 ],
11 importpath = "code.hackerspace.pl/hscloud/hswaw/smsgw",
12 visibility = ["//visibility:private"],
13 deps = [
14 "//go/mirko:go_default_library",
15 "//hswaw/smsgw/proto:go_default_library",
16 "@com_github_golang_glog//:go_default_library",
17 "@org_golang_google_grpc//codes:go_default_library",
18 "@org_golang_google_grpc//status:go_default_library",
19 ],
20)
21
22go_binary(
23 name = "smsgw",
24 embed = [":go_default_library"],
25 visibility = ["//visibility:public"],
26)
27
28go_test(
29 name = "go_default_test",
30 srcs = ["dispatcher_test.go"],
31 embed = [":go_default_library"],
32)
Sergiusz Bazanski6f773e02019-10-02 20:46:48 +020033
34container_layer(
35 name = "layer_bin",
36 files = [
37 ":smsgw",
38 ],
39 directory = "/smsgw/",
40)
41
42container_image(
43 name = "runtime",
44 base = "@prodimage-bionic//image",
45 layers = [
46 ":layer_bin",
47 ],
48)
49
50container_push(
51 name = "push",
52 image = ":runtime",
53 format = "Docker",
54 registry = "registry.k0.hswaw.net",
55 repository = "q3k/smsgs",
56 tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
57)