Skip to content

Commit cca97e7

Browse files
committed
feat: wire conflow config validation pipeline
1 parent b1bdccd commit cca97e7

3 files changed

Lines changed: 58 additions & 0 deletions

File tree

.conflow.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# conflow pipeline - Full generate → validate → export
2+
version: "1"
3+
name: "tma-mark2"
4+
5+
stages:
6+
- name: "generate"
7+
description: "Generate configuration using Nickel"
8+
tool:
9+
type: nickel
10+
command: export
11+
file: configs/config.ncl
12+
format: json
13+
input: "configs/config.ncl"
14+
output: generated/config.json
15+
16+
- name: "validate"
17+
description: "Validate against CUE schema"
18+
tool:
19+
type: cue
20+
command: vet
21+
schemas:
22+
- schemas/config.cue
23+
input:
24+
from_stage: generate
25+
depends_on:
26+
- generate
27+
28+
- name: "export"
29+
description: "Export final configuration as YAML"
30+
tool:
31+
type: cue
32+
command: export
33+
out_format: yaml
34+
input:
35+
from_stage: generate
36+
output: deploy/config.yaml
37+
depends_on:
38+
- validate

configs/config.ncl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Configuration generation
2+
{
3+
name = "my-app",
4+
replicas =
5+
let env = "dev" in
6+
if env == "prod" then 5
7+
else if env == "staging" then 3
8+
else 1,
9+
port = 8080,
10+
env = "dev",
11+
}

schemas/config.cue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Configuration schema
2+
package config
3+
4+
#Config: {
5+
name: string
6+
replicas: int & >=1
7+
port: int & >=1 & <=65535
8+
env: string
9+
}

0 commit comments

Comments
 (0)