blob: 7b5af446273e1093e7d078741c5f78cbf793bb3e [file] [log] [blame]
Serge Bazanskieb09c6a2020-10-06 17:28:19 +02001load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push")
Sergiusz Bazanskif448f992019-07-13 16:16:23 +02002load("@io_bazel_rules_go//go:def.bzl", "go_library")
3load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
4
5go_embed_data(
6 name = "static",
7 srcs = ["index.html", "speedtest.js", "speedtest_worker.js"],
8 package = "static",
9)
10
11# keep
12go_library(
13 name = "static_go",
14 srcs = [":static"],
Sergiusz Bazanskicea71e32019-07-21 15:30:08 +020015 importpath = "code.hackerspace.pl/hscloud/bgpwtf/speedtest/static",
Sergiusz Bazanskif448f992019-07-13 16:16:23 +020016 visibility = ["//visibility:public"],
17)
18
Sergiusz Bazanski3e212332019-07-13 18:10:21 +020019container_image(
20 name="latest",
21 base="@prodimage-bionic//image",
Sergiusz Bazanskicea71e32019-07-21 15:30:08 +020022 files = ["//bgpwtf/speedtest/backend:backend"],
Sergiusz Bazanski3e212332019-07-13 18:10:21 +020023 directory = "/hscloud",
24 entrypoint = ["/hscloud/backend"],
25)
26
Serge Bazanskieb09c6a2020-10-06 17:28:19 +020027container_push(
28 name = "push",
29 image = ":latest",
30 format = "Docker",
31 registry = "registry.k0.hswaw.net",
32 repository = "q3k/speedetst",
33 tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
Sergiusz Bazanski3e212332019-07-13 18:10:21 +020034)