-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbootstrap_tool.cue
More file actions
58 lines (54 loc) · 1.21 KB
/
bootstrap_tool.cue
File metadata and controls
58 lines (54 loc) · 1.21 KB
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
package bootstrap
import (
"tool/cli"
"tool/exec"
"text/tabwriter"
)
// The bootstrap command targets the cluster specified with '-t cluster=name'.
command: bootstrap: {
clusterName: string @tag(cluster)
for c in clusters {
if c.name == clusterName {
"print-\(c.name)": cli.Print & {
text: "► starting bootstrap for \(c.name)"
}
"run-\(c.name)": exec.Run & {
$after: "print-\(c.name)"
cmd: [
"flux",
"bootstrap",
"git",
"--url=\(c.git.url)",
"--path=\(c.git.path)",
"--branch=\(c.git.branch)",
"--token-auth",
"--password=\(c.git.token)",
"--namespace=\(c.flux.namespace)",
for com in c.flux.components {
"--components=\(com)"
},
if c.kubeconfig.context != "" {
"--context=\(c.kubeconfig.context)"
},
if c.kubeconfig.path != "" {
"--kubeconfig=\(c.kubeconfig.path)"
},
if c.flux.version != _|_ {
"--version=\(c.flux.version)"
},
]
}
}
}
}
// The ls command prints a table with the defined clusters.
command: ls: {
task: print: cli.Print & {
text: tabwriter.Write([
"CLUSTER \tREPOSITORY \tPATH",
for c in clusters {
"\(c.name) \t\(c.git.url) \t\(c.git.path)"
},
])
}
}