Feature 57 (config and provisioning): modules declare config and provisions, their files rendered from templates; synced with main (issues of feature 57, 874)
This commit is contained in:
@@ -31,10 +31,22 @@ func TestTheArchivePlacesExactlyOneFile(t *testing.T) {
|
||||
if r["type"] != "archive" || r["path"] != "/usr/local/bin" {
|
||||
t.Fatalf("its resource is %v", r)
|
||||
}
|
||||
if len(m.Build.Artifacts) != 1 {
|
||||
t.Fatalf("it builds %d artifacts", len(m.Build.Artifacts))
|
||||
// The build has a second artifact, the files archive the controller reads the templates back from; it
|
||||
// places no file. The artifact the resource unpacks is the one that does.
|
||||
var a map[string]any
|
||||
for _, candidate := range m.Build.Artifacts {
|
||||
if candidate["name"] == r["artifact"] {
|
||||
if a != nil {
|
||||
t.Fatalf("two artifacts are named %v", r["artifact"])
|
||||
}
|
||||
a = candidate
|
||||
} else if candidate["kind"] != "archive" || candidate["from"] != "files" {
|
||||
t.Fatalf("it builds %v beside the artifact that places the file", candidate)
|
||||
}
|
||||
}
|
||||
if a == nil {
|
||||
t.Fatalf("no artifact is named %v", r["artifact"])
|
||||
}
|
||||
a := m.Build.Artifacts[0]
|
||||
if a["name"] != r["artifact"] || a["kind"] != "bundle" || a["language"] != "go" || a["binary"] != "mesh-cli" ||
|
||||
a["from"] != "cmd/mesh-cli" {
|
||||
t.Fatalf("its artifact is %v, unpacked as %v", a, r["artifact"])
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# The operator's command (module mesh-cli, novox/hq ADR 0272): nox is mesh-cli, in interactive zsh only.
|
||||
# A script, sudo and a document meant to work everywhere say mesh-cli.
|
||||
alias nox=mesh-cli
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"module": "mesh-cli",
|
||||
"version": "1",
|
||||
"moved": true,
|
||||
"resources": [
|
||||
{
|
||||
"id": "program",
|
||||
@@ -9,11 +10,10 @@
|
||||
"path": "/usr/local/bin"
|
||||
}
|
||||
],
|
||||
"shell": [
|
||||
"items": [
|
||||
{
|
||||
"for": "zsh",
|
||||
"slot": "normal",
|
||||
"code": "# The operator's command (module mesh-cli, novox/hq ADR 0272): nox is mesh-cli, in interactive zsh only.\n# A script, sudo and a document meant to work everywhere say mesh-cli.\nalias nox=mesh-cli\n"
|
||||
"collection": "shell:zsh:normal",
|
||||
"template": "files/zsh-normal"
|
||||
}
|
||||
],
|
||||
"build": {
|
||||
@@ -25,6 +25,11 @@
|
||||
"system": "arch",
|
||||
"from": "cmd/mesh-cli",
|
||||
"binary": "mesh-cli"
|
||||
},
|
||||
{
|
||||
"name": "files",
|
||||
"kind": "archive",
|
||||
"from": "files"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user