File tree 3 files changed +51
-22
lines changed 3 files changed +51
-22
lines changed Original file line number Diff line number Diff line change 9
9
only_branch_master_parent_repo : &only_branch_master_parent_repo
10
10
- ' master@saltstack-formulas/template-formula'
11
11
# `stage`
12
- stage_constraints : &stage_constraints 'constraints '
12
+ stage_schema : &stage_schema 'schema '
13
13
stage_lint : &stage_lint 'lint'
14
14
stage_release : &stage_release 'release'
15
15
stage_test : &stage_test 'test'
16
16
# `image`
17
17
image_commitlint : &image_commitlint 'myii/ssf-commitlint:11'
18
+ image_cuelang : &image_cuelang
19
+ name : ' myii/ssf-cue:0.3.2' # instead of cuelang/cue
20
+ entrypoint : ['/bin/ash', '-c']
18
21
image_dindruby : &image_dindruby 'myii/ssf-dind-ruby:2.7.1-r3'
19
22
image_dindrubybionic : &image_dindrubybionic 'myii/ssf-dind-ruby-bionic:1_2.5.1'
20
23
image_precommit : &image_precommit
42
45
# ##############################################################################
43
46
stages :
44
47
- *stage_lint
48
+ - *stage_schema
45
49
- *stage_test
46
50
- *stage_release
47
51
variables :
@@ -101,6 +105,16 @@ rubocop:
101
105
script :
102
106
- ' rubocop -d -P -S --enable-pending-cops'
103
107
108
+ cue :
109
+ allow_failure : true
110
+ stage : *stage_schema
111
+ image : *image_cuelang
112
+ variables :
113
+ DIR : ' TEMPLATE/parameters'
114
+ RULES : ' schema.cue'
115
+ script :
116
+ - ' cue vet -v $(find ${DIR} -name "*.yaml") ${DIR}/{RULES} --schema "#Values"'
117
+
104
118
# ##############################################################################
105
119
# Define `test` template
106
120
# ##############################################################################
Original file line number Diff line number Diff line change 13
13
---
14
14
values :
15
15
pkg :
16
- name : TEMPLATE-fedora
16
+ name : 11
17
+ # TEMPLATE-fedora
17
18
service :
18
19
name : service-fedora
19
20
...
Original file line number Diff line number Diff line change 1
1
// -*- coding : utf-8 -*-
2
2
// vim : ft=yaml
3
+
4
+ //
5
+ // Data Constaints - Example from Saltstack-formulas
3
6
//
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
7
9
- // template-formula
10
- # template: {
11
- pkg? : name?: string
8
+ # Schema: #Values
9
+
10
+ //
11
+ // Rule
12
+ //
13
+ # Optional: {
14
+ pkg? :
15
+ name? : string
12
16
rootgroup? : string
13
17
hide_output? : bool
14
18
dir_mode? : =~"^0?[124567]{3}$" // any mode of length 3, with 0 prefix optional
27
31
winner? : string
28
32
...
29
33
}
30
- values? : {...#template} // probable yaml namespace
31
34
32
35
//
33
- // support formula diversity :-)
36
+ // Schema Name
34
37
//
38
+ # Values: {
39
+ values? : {...#Optional}
40
+ }
41
+ values? : {...#Values} // Namespace
42
+
35
43
36
- template? : {...#template} // another probable namespace
44
+ //
45
+ // Older schema
46
+ //
47
+ # TEMPLATE: {
48
+ TEMPLATE? : {...#Optional}
49
+ }
50
+ TEMPLATE? : {...#Optional}
37
51
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
52
+ Debian? : # Optional
53
+ Suse? : # Optional
54
+ Gentoo? : # Optional
55
+ Arch? : # Optional
56
+ Alpine? : # Optional
57
+ FreeBSD? : # Optional
58
+ OpenBSD? : # Optional
59
+ Solaris? : # Optional
60
+ Windows? : # Optional
61
+ MacOS? : # Optional
You can’t perform that action at this time.
0 commit comments