blob: 87d41b8797e2c9e05c322da3fc2dcf9fdcf133e1 [file] [log] [blame]
Sergiusz Bazanskia8854882020-01-05 00:34:38 +01001load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push")
2load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
3
4go_library(
5 name = "go_default_library",
6 srcs = [
7 "main.go",
8 "telegram.go",
9 ],
10 importpath = "code.hackerspace.pl/hscloud/personal/q3k/lelegram",
11 visibility = ["//visibility:private"],
12 deps = [
13 "//go/mirko:go_default_library",
14 "//personal/q3k/lelegram/irc:go_default_library",
15 "@com_github_go_telegram_bot_api_telegram_bot_api//:go_default_library",
16 "@com_github_golang_glog//:go_default_library",
17 ],
18)
19
20go_binary(
21 name = "lelegram",
22 embed = [":go_default_library"],
23 visibility = ["//visibility:public"],
24)
25
26container_layer(
27 name = "layer_bin",
28 files = [
29 ":lelegram",
30 ],
31 directory = "/lelegram/",
32)
33
34container_image(
35 name = "runtime",
36 base = "@prodimage-bionic//image",
37 layers = [
38 ":layer_bin",
39 ],
40)
41
42container_push(
43 name = "push",
44 image = ":runtime",
45 format = "Docker",
46 registry = "registry.k0.hswaw.net",
47 repository = "q3k/lelegram",
48 tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
49)