Skip to content

Commit

Permalink
feat(schema constraints): use cuelang for schema constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Apr 2, 2021
1 parent bbe1c78 commit f49672d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
only_branch_master_parent_repo: &only_branch_master_parent_repo
- 'master@saltstack-formulas/template-formula'
# `stage`
stage_constraints: &stage_constraints 'constraints'
stage_lint: &stage_lint 'lint'
stage_release: &stage_release 'release'
stage_test: &stage_test 'test'
Expand Down
46 changes: 46 additions & 0 deletions TEMPLATE/parameters/schema.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// -*- coding: utf-8 -*-
// vim: ft=yaml
//
// Constraints Schema:
// This is not a prescriptive or forced schema! Many variants of
// formula (and yaml data) exist in the salt user community.

// template-formula
#template: {
pkg?: name?: string
rootgroup?: string
hide_output?: bool
dir_mode?: =~"^0?[124567]{3}$" // any mode of length 3, with 0 prefix optional
mode?: =~"^0?[124567]{3}$" // any mode of length 3, with 0 prefix optional
config?: string
service?: name?: string
subcomponent?: config: string

// legacy
pip_pkg?: string
pkgs_add?: [...]
pips?: [...]

// Just here for testing
added_in_defaults?: string
winner?: string
...
}
values?: {...#template} // probable yaml namespace

//
// support community diversity :-)
//

template?: {...#template} // another probable namespace

Debian?: #template
Suse?: #template
Gentoo?: #template
Arch?: #template
Alpine?: #template
FreeBSD?: #template
OpenBSD?: #template
Solaris?: #template
Windows?: #template
MacOS?: #template

0 comments on commit f49672d

Please sign in to comment.