Sergiusz Bazanski | 6f773e0 | 2019-10-02 20:46:48 +0200 | [diff] [blame] | 1 | load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push") |
Sergiusz Bazanski | 325e947 | 2019-09-27 02:49:47 +0200 | [diff] [blame] | 2 | load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") |
| 3 | |
| 4 | go_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 | |
| 22 | go_binary( |
| 23 | name = "smsgw", |
| 24 | embed = [":go_default_library"], |
| 25 | visibility = ["//visibility:public"], |
| 26 | ) |
| 27 | |
| 28 | go_test( |
| 29 | name = "go_default_test", |
| 30 | srcs = ["dispatcher_test.go"], |
| 31 | embed = [":go_default_library"], |
| 32 | ) |
Sergiusz Bazanski | 6f773e0 | 2019-10-02 20:46:48 +0200 | [diff] [blame] | 33 | |
| 34 | container_layer( |
| 35 | name = "layer_bin", |
| 36 | files = [ |
| 37 | ":smsgw", |
| 38 | ], |
| 39 | directory = "/smsgw/", |
| 40 | ) |
| 41 | |
| 42 | container_image( |
| 43 | name = "runtime", |
| 44 | base = "@prodimage-bionic//image", |
| 45 | layers = [ |
| 46 | ":layer_bin", |
| 47 | ], |
| 48 | ) |
| 49 | |
| 50 | container_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 | ) |