Skip to content

Commit a46296d

Browse files
feat(schema constraints): use cuelang for schema constraints
1 parent bbe1c78 commit a46296d

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.gitlab-ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
only_branch_master_parent_repo: &only_branch_master_parent_repo
1010
- 'master@saltstack-formulas/template-formula'
1111
# `stage`
12+
stage_constraints: &stage_constraints 'constraints'
1213
stage_lint: &stage_lint 'lint'
1314
stage_release: &stage_release 'release'
1415
stage_test: &stage_test 'test'

TEMPLATE/parameters/schema.cue

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// -*- coding: utf-8 -*-
2+
// vim: ft=yaml
3+
//
4+
// Constraints Schema:
5+
// This is not a prescriptive or forced schema! Many variants of
6+
// formula (and yaml data) exist in the salt user community.
7+
// Therefore the use of cue '?' and "aliases" is recommended.
8+
9+
// template-formula
10+
#template: {
11+
pkg?: name?: string
12+
rootgroup?: string
13+
hide_output?: bool
14+
dir_mode?: =~"^0?[124567]{3}$" // any mode of length 3, with 0 prefix optional
15+
mode?: =~"^0?[124567]{3}$" // any mode of length 3, with 0 prefix optional
16+
config?: string
17+
service?: name?: string
18+
subcomponent?: config?: string
19+
20+
// legacy
21+
pip_pkg?: string
22+
pkgs_add?: [...]
23+
pips?: [...]
24+
25+
// Just here for testing
26+
added_in_defaults?: string
27+
winner?: string
28+
...
29+
}
30+
values?: {...#template} // probable yaml namespace
31+
32+
//
33+
// support formula diversity :-)
34+
//
35+
36+
template?: {...#template} // another probable namespace
37+
38+
Debian?: #template
39+
Suse?: #template
40+
Gentoo?: #template
41+
Arch?: #template
42+
Alpine?: #template
43+
FreeBSD?: #template
44+
OpenBSD?: #template
45+
Solaris?: #template
46+
Windows?: #template
47+
MacOS?: #template

0 commit comments

Comments
 (0)