forked from ceason/rules_terraform
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD
70 lines (63 loc) · 1.47 KB
/
BUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
load("//experimental:k8s.bzl", "terraform_k8s_manifest")
load("//experimental:publishing.bzl", "embedded_reference", "file_uploader")
load("//terraform:def.bzl", "terraform_module")
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
load("@io_bazel_rules_docker//python:image.bzl", "py_image")
py_image(
name = "py_image",
srcs = ["server.py"],
main = "server.py",
)
container_push(
name = "push_py_image",
format = "Docker",
image = ":py_image",
registry = "$(IMAGE_REGISTRY)",
repository = "hello-world-server",
stamp = True,
tag = "dev",
visibility = ["//visibility:public"],
)
terraform_k8s_manifest(
name = "k8s-deployment",
srcs = ["server.yaml"],
deps = [
":push_py_image",
],
)
embedded_reference(
name = "ecs-task-containers",
src = "ecs-task-containers.json.tpl",
out = "ecs-task-containers.json",
deps = [
":push_py_image",
],
)
terraform_module(
name = "hello-world_tf",
srcs = [
"main.tf",
],
visibility = ["//visibility:public"],
)
terraform_module(
name = "hello-world_k8s",
srcs = [
"k8s.tf",
"main.tf",
],
embed = [":k8s-deployment"],
visibility = ["//visibility:public"],
)
terraform_module(
name = "hello-world_ecs",
srcs = [
"ecs.tf",
"ecs-plumbing.tf",
"main.tf",
],
data = [
":ecs-task-containers",
],
visibility = ["//visibility:public"],
)