Skip to content

Commit

Permalink
fix: make components & checkPaths optional, update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nxcc committed Feb 3, 2023
1 parent 9d51734 commit 3abb710
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 30 deletions.
1 change: 1 addition & 0 deletions examples/configmap/cuegen.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cuegen: objectsPath: "objects"
1 change: 0 additions & 1 deletion examples/configmap/cuegen.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cuegen: {
objectsPath: "objects"
secretDataPath: "secret.*.data"
checkPaths: [
"values",
"global",
]
components: [
"../../../charts/mongodb",
"../../../charts/wekan",
]
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cuegen: {
objectsPath: "objects"
secretDataPath: "secret.*.data"
checkPaths: [
"values",
"global",
]
components: [
"https://github.com/nxcc/cuegen-example-mongodb?ref=v1.2.0",
"https://github.com/nxcc/cuegen-example-wekan?ref=v1.2.0",
]
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cuegen: {
objectsPath: "objects"
secretDataPath: "secret.*.data"
checkPaths: [
"values",
"global",
]
components: [
"https://github.com/nxcc/cuegen-example-mongodb?ref=v1.2.0",
"https://github.com/nxcc/cuegen-example-wekan?ref=v1.2.0",
]
}

This file was deleted.

4 changes: 4 additions & 0 deletions examples/encrypted/cuegen.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cuegen: {
objectsPath: "objects"
secretDataPath: "secret.*.data"
}
2 changes: 0 additions & 2 deletions examples/encrypted/cuegen.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions examples/values/cuegen.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cuegen: objectsPath: "objects"
components: []
1 change: 0 additions & 1 deletion examples/values/cuegen.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions internal/app/schema.cue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cuegen: close({
objectsPath: string
checkPath: *"" | string
checkPaths: [ ...string]
checkPaths?: [ ...string]
secretDataPath: *"" | string
debug: *false | bool
components: [string, ...]
components?: [string, ...]
})
28 changes: 28 additions & 0 deletions scripts/test-all-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -euo pipefail
cd "$(dirname "$0")/../examples"

trap "echo ' FAILED'" EXIT

echo configmap...
cuegen configmap | grep -q "2023-01-10T12:00:00Z"
echo " OK"

echo values...
cuegen values | grep -q "7 replicas configured"
echo " OK"

echo encrypted...
SOPS_AGE_KEY=AGE-SECRET-KEY-14QUHLE5A6UNSKNYXLF5ZA26P3NCFX8P68JQ066T7VJ6JW5G8FHWQN4HAUQ \
cuegen encrypted | grep -q IEtFWS0tLS0tCk1JSUV2Z0paTXF
echo " OK"

echo control-repository
cuegen control-repository/control/dev-cluster/wekan-dev/ | grep -q "namespace: cuegen-demo-dev"
cuegen control-repository/control/prod-cluster/wekan-prod/ | grep -q "namespace: cuegen-demo-prod"
cuegen control-repository/control/prod-cluster/wekan-qa/ | grep -q "namespace: cuegen-demo-qa"
echo " OK"

trap "" EXIT
echo "all tests successful"

0 comments on commit 3abb710

Please sign in to comment.