blob: e25c31e56f07a847d2317f2474a858e5ff92985b [file] [log] [blame]
giolekva7c5a0672020-12-11 17:40:49 +04001load("@io_bazel_rules_go//go:def.bzl", "go_binary")
2load("@io_bazel_rules_docker//container:container.bzl", "container_push", "container_image")
3load("@rules_pkg//:pkg.bzl", "pkg_tar")
4
5go_binary(
6 name = "photos_ui",
7 srcs = ["main.go"],
8 data = glob([
9 "static/**",
10 "*.html",
11 ]),
12 deps = [
13 "@io_bazel_rules_go//go/tools/bazel:bazel",
14 ],
15)
16
17filegroup(
18 name = "runfiles",
19 srcs = glob([
20 "static/**",
21 "*.html",
22 "photos_ui.runfiles_manifest",
23 ]),
24)
25
26container_image(
27 name = "container",
28 base = "@alpine_base//image",
29 files = [":photos_ui", ":runfiles"],
30 data_path = "/",
31 cmd = ["/photos_ui"],
32 env = {
33 "RUNFILES_DIR": "/",
34 "RUNFILES_MANIFEST_FILE": "/photos_ui.runfiles_manifest",
35 },
36 symlinks = {
37 "/photos_ui": "/apps/photos-ui/photos_ui_/photos_ui",
38 },
39)
40
41container_push(
42 name = "push_to_dev",
43 image = ":container",
44 format = "Docker",
45 registry = "localhost:30500",
46 repository = "giolekva/photos-ui",
47 tag = "latest",
48)
49
50pkg_tar(
51 name = "chart",
52 srcs = glob(["chart/**"]),
53 extension = "tar.gz",
54 strip_prefix = "./chart",
55)