forked from openshift/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
132 lines (111 loc) · 2.58 KB
/
BUILD.bazel
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
load("//bazel-rules:gen_test.bzl", "gen_test")
load("//:version.bzl", "TECTONIC_VERSION")
package(
default_visibility = ["//visibility:public"],
)
config_setting(
name = "darwin",
values = {"cpu": "darwin"},
visibility = ["//visibility:public"],
)
config_setting(
name = "linux",
values = {"cpu": "k8"}, # don't ask...
visibility = ["//visibility:public"],
)
genrule(
name = "terraform_runtime_fmt",
srcs = select({
"//:linux": ["@terraform_runtime_linux//:terraform"],
"//:darwin": ["@terraform_runtime_darwin//:terraform"],
}),
outs = ["bin/terraform"],
cmd = "cp $(<) $(@)",
executable = True,
output_to_bindir = 1,
)
load("@io_bazel_rules_go//go:def.bzl", "go_prefix")
go_prefix("github.com/openshift/installer")
load("@bazel_gazelle//:def.bzl", "gazelle")
gazelle(
name = "gazelle",
command = "fix",
external = "vendored",
prefix = "github.com/openshift/installer",
)
alias(
name = "smoke_tests",
actual = "//tests/smoke:smoke",
)
alias(
name = "cli",
actual = "//installer/cmd/tectonic",
)
template_files = glob([
"modules/**/*",
"steps/**/*",
"config.tf",
])
exports_files(template_files)
filegroup(
name = "template_resources",
srcs = template_files,
)
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
alias(
name = "tarball",
actual = ":tectonic-%s" % TECTONIC_VERSION,
)
pkg_tar(
name = "tectonic-%s" % TECTONIC_VERSION,
mode = "0666",
srcs = [
"//:template_resources",
"//examples:tectonic_cli_examples",
],
extension = "tar.gz",
package_dir = "tectonic-%s" % TECTONIC_VERSION,
strip_prefix = ".",
deps = [
":cli_bin",
":tf_bin",
],
)
pkg_tar(
name = "cli_bin",
mode = "0777",
srcs = ["//installer/cmd/tectonic"],
package_dir = "installer",
)
filegroup(
name = "terraform_runtime",
srcs = select({
"//:linux": ["@terraform_runtime_linux//:terraform"],
"//:darwin": ["@terraform_runtime_darwin//:terraform"],
}),
)
pkg_tar(
name = "tf_bin",
mode = "0777",
srcs = [":terraform_runtime"],
package_dir = "installer",
)
filegroup(
name = "terraform_files",
srcs = glob(
["modules/**/*.tf"],
exclude_directories = 1,
) + glob(
["steps/**/*.tf"],
exclude_directories = 1,
) + ["config.tf"],
)
gen_test(
name = "terraform_fmt",
size = "small",
command = "./bin/terraform fmt -list -check -write=false",
deps = [
":terraform_files",
":terraform_runtime_fmt",
],
)