blob: 9635db4ee2a799c743da303a5e387e8a892bc136 [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(
Serge Bazanski97b5cd72023-07-28 17:14:50 +00005 name = "lelegram_lib",
Sergiusz Bazanskia8854882020-01-05 00:34:38 +01006 srcs = [
7 "main.go",
8 "telegram.go",
9 ],
10 importpath = "code.hackerspace.pl/hscloud/personal/q3k/lelegram",
11 visibility = ["//visibility:private"],
12 deps = [
Serge Bazanski97b5cd72023-07-28 17:14:50 +000013 "//go/mirko",
14 "//personal/q3k/lelegram/irc",
15 "@com_github_go_telegram_bot_api_telegram_bot_api//:telegram-bot-api",
16 "@com_github_golang_glog//:glog",
Sergiusz Bazanskia8854882020-01-05 00:34:38 +010017 ],
18)
19
20go_binary(
21 name = "lelegram",
Serge Bazanski97b5cd72023-07-28 17:14:50 +000022 embed = [":lelegram_lib"],
Sergiusz Bazanskia8854882020-01-05 00:34:38 +010023 visibility = ["//visibility:public"],
24)
25
26container_layer(
27 name = "layer_bin",
Serge Bazanski97b5cd72023-07-28 17:14:50 +000028 directory = "/lelegram/",
Sergiusz Bazanskia8854882020-01-05 00:34:38 +010029 files = [
30 ":lelegram",
31 ],
Sergiusz Bazanskia8854882020-01-05 00:34:38 +010032)
33
34container_image(
35 name = "runtime",
36 base = "@prodimage-bionic//image",
37 layers = [
38 ":layer_bin",
39 ],
40)
41
42container_push(
43 name = "push",
Sergiusz Bazanskia8854882020-01-05 00:34:38 +010044 format = "Docker",
Serge Bazanski97b5cd72023-07-28 17:14:50 +000045 image = ":runtime",
Sergiusz Bazanskia8854882020-01-05 00:34:38 +010046 registry = "registry.k0.hswaw.net",
47 repository = "q3k/lelegram",
48 tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
49)