blob: 5f55a0048873b008877095d8c233f0ac57461e19 [file] [log] [blame]
Serge Bazanski1f062302021-06-01 22:24:34 +00001load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push")
Serge Bazanskia7674672021-05-30 21:09:34 +00002load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
3
4go_library(
Serge Bazanski97b5cd72023-07-28 17:14:50 +00005 name = "site_lib",
Serge Bazanski56c888b2021-05-30 21:48:58 +00006 srcs = [
Serge Bazanskid2271de2021-07-11 21:26:37 +00007 "at.go",
Serge Bazanski717aad42021-07-11 16:03:43 +00008 "events.go",
Serge Bazanski3c9092a2021-05-30 23:15:20 +00009 "feeds.go",
Serge Bazanski56c888b2021-05-30 21:48:58 +000010 "main.go",
Serge Bazanski11b276d2021-07-11 23:49:55 +000011 "spaceapi.go",
Serge Bazanski56c888b2021-05-30 21:48:58 +000012 "views.go",
13 ],
Serge Bazanskia7674672021-05-30 21:09:34 +000014 importpath = "code.hackerspace.pl/hscloud/hswaw/site",
15 visibility = ["//visibility:private"],
16 deps = [
Serge Bazanski97b5cd72023-07-28 17:14:50 +000017 "//go/mirko",
18 "//hswaw/site/calendar",
Serge Bazanskia7674672021-05-30 21:09:34 +000019 "//hswaw/site/static:static_go",
Serge Bazanski56c888b2021-05-30 21:48:58 +000020 "//hswaw/site/templates:templates_go",
Serge Bazanski97b5cd72023-07-28 17:14:50 +000021 "@com_github_golang_glog//:glog",
Serge Bazanskia7674672021-05-30 21:09:34 +000022 ],
23)
24
25go_binary(
26 name = "site",
Serge Bazanski97b5cd72023-07-28 17:14:50 +000027 embed = [":site_lib"],
Serge Bazanski80cee0a2023-09-22 22:19:33 +000028 pure = "on",
29 static = "on",
Serge Bazanskia7674672021-05-30 21:09:34 +000030 visibility = ["//visibility:public"],
31)
Serge Bazanski1f062302021-06-01 22:24:34 +000032
33container_image(
Serge Bazanski11b276d2021-07-11 23:49:55 +000034 name = "latest",
Serge Bazanskif642e862022-02-01 09:46:02 +000035 base = "@prodimage-focal//image",
Serge Bazanski1f062302021-06-01 22:24:34 +000036 directory = "/hswaw/site/",
37 entrypoint = ["/hswaw/site/site"],
Serge Bazanski97b5cd72023-07-28 17:14:50 +000038 files = [":site"],
Serge Bazanski1f062302021-06-01 22:24:34 +000039)
40
41container_push(
42 name = "push",
Serge Bazanski1f062302021-06-01 22:24:34 +000043 format = "Docker",
Serge Bazanski97b5cd72023-07-28 17:14:50 +000044 image = ":latest",
Serge Bazanski1f062302021-06-01 22:24:34 +000045 registry = "registry.k0.hswaw.net",
Serge Bazanski80cee0a2023-09-22 22:19:33 +000046 repository = "q3k/hswaw-site",
47 tag = "1695421189-{STABLE_GIT_COMMIT}",
Serge Bazanski1f062302021-06-01 22:24:34 +000048)