blob: 0e911418bfe7a3397a03a18d8cdfb47dcefe9c99 [file] [log] [blame]
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = [
"dispatcher.go",
"main.go",
"twilio.go",
],
importpath = "code.hackerspace.pl/hscloud/hswaw/smsgw",
visibility = ["//visibility:private"],
deps = [
"//go/mirko:go_default_library",
"//hswaw/smsgw/proto:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
],
)
go_binary(
name = "smsgw",
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
srcs = ["dispatcher_test.go"],
embed = [":go_default_library"],
)
container_layer(
name = "layer_bin",
files = [
":smsgw",
],
directory = "/smsgw/",
)
container_image(
name = "runtime",
base = "@prodimage-bionic//image",
layers = [
":layer_bin",
],
)
container_push(
name = "push",
image = ":runtime",
format = "Docker",
registry = "registry.k0.hswaw.net",
repository = "q3k/smsgs",
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
)