Skip to content

Commit f49672d

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

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-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

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
8+
// template-formula
9+
#template: {
10+
pkg?: name?: string
11+
rootgroup?: string
12+
hide_output?: bool
13+
dir_mode?: =~"^0?[124567]{3}$" // any mode of length 3, with 0 prefix optional
14+
mode?: =~"^0?[124567]{3}$" // any mode of length 3, with 0 prefix optional
15+
config?: string
16+
service?: name?: string
17+
subcomponent?: config: string
18+
19+
// legacy
20+
pip_pkg?: string
21+
pkgs_add?: [...]
22+
pips?: [...]
23+
24+
// Just here for testing
25+
added_in_defaults?: string
26+
winner?: string
27+
...
28+
}
29+
values?: {...#template} // probable yaml namespace
30+
31+
//
32+
// support community diversity :-)
33+
//
34+
35+
template?: {...#template} // another probable namespace
36+
37+
Debian?: #template
38+
Suse?: #template
39+
Gentoo?: #template
40+
Arch?: #template
41+
Alpine?: #template
42+
FreeBSD?: #template
43+
OpenBSD?: #template
44+
Solaris?: #template
45+
Windows?: #template
46+
MacOS?: #template

0 commit comments

Comments
 (0)