@@ -12,18 +12,155 @@ modules:
1212 - example.sh
1313
1414 - type : script
15+ env :
16+ TEST_ARG_2 : " another"
17+ if :
18+ env :
19+ exists :
20+ - TEST_ARG
21+ - TEST_ARG_2
22+ snippets :
23+ - exit 1
24+
25+ - type : script
26+ env :
27+ TEST_ARG : " test"
28+ TEST_ARG_2 : " another"
29+ if :
30+ env :
31+ not-exists :
32+ - TEST_ARG
33+ - TEST_ARG_2
34+ snippets :
35+ - exit 1
36+
37+ - type : script
38+ env :
39+ TEST_ARG : " test"
40+ if :
41+ env :
42+ equals :
43+ TEST_ARG :
44+ - no-test
45+ - some-test
1546 snippets :
16- - ' [ -z "$TEST_ARG" ] '
47+ - exit 1
1748
1849 - type : script
1950 env :
2051 TEST_ARG : " test"
52+ if :
53+ env :
54+ not-equals :
55+ TEST_ARG :
56+ - test
57+ - some-test
58+ snippets :
59+ - exit 1
60+
61+ - type : script
62+ env :
63+ TEST_ARG : " test"
64+ TEST_ARG_2 : " another"
65+ if : ' [ "$TEST_ARG" = "$TEST_ARG_2" ]'
66+ snippets :
67+ - exit 1
68+
69+ - type : script
70+ env :
71+ TEST_ARG : " test"
72+ TEST_ARG_2 : " another"
73+ if :
74+ eval : ' [ "$TEST_ARG" = "$TEST_ARG_2" ]'
75+ env :
76+ exists :
77+ - TEST_ARG_2
78+ - TEST_ARG_3
79+ not-exists : TEST_ARG
80+ equals :
81+ TEST_ARG :
82+ - no-test
83+ - some-test
84+ not-equals :
85+ TEST_ARG_2 : another
86+ snippets :
87+ - exit 1
88+
89+ - type : script
90+ if :
91+ host-file :
92+ exists :
93+ - ./non-existant-file.txt
94+ - ./another-non-existant-file.txt
95+ snippets :
96+ - exit 1
97+
98+ - type : script
99+ if :
100+ host-file :
101+ not-exists :
102+ - ./test_secret_file.txt
103+ - ./secrets/test-secret
104+ snippets :
105+ - exit 1
106+
107+ - type : script
108+ if :
109+ host-env :
110+ exists :
111+ - NON_EXISTANT_VAR
112+ - ANOTHER_NON_EXISTANT_VAR
113+ snippets :
114+ - exit 1
115+
116+ - type : script
117+ if :
118+ host-env :
119+ not-exists :
120+ - TEST_SECRET
121+ - SOME_TEST_VAR
122+ snippets :
123+ - exit 1
124+
125+ - type : script
126+ if :
127+ host-env :
128+ equals :
129+ TEST_SECRET : test321
130+ SOME_TEST_VAR :
131+ - some_value
132+ - another_possible_value
133+ snippets :
134+ - exit 1
135+
136+ - type : script
137+ if :
138+ host-env :
139+ not-equals :
140+ TEST_SECRET : test123
141+ SOME_TEST_VAR :
142+ - something
143+ - another_possible_value
144+ snippets :
145+ - exit 1
146+
147+ - type : script
148+ if :
149+ host-exec :
150+ cmd : ./host_exec.sh
151+ args :
152+ - ' 1'
21153 snippets :
22- - ' [ "$TEST_ARG" = "test" ] '
154+ - exit 1
23155
24156 - type : script
157+ if :
158+ not-host-exec :
159+ cmd : ./host_exec.sh
160+ args :
161+ - ' 0'
25162 snippets :
26- - ' [ -z "$TEST_ARG" ] '
163+ - exit 1
27164
28165 - type : dnf
29166 repos :
@@ -84,6 +221,9 @@ modules:
84221
85222 # Testing secrets
86223 - type : script
224+ if :
225+ host-env :
226+ exists : TEST_SECRET
87227 secrets :
88228 - type : env
89229 name : TEST_SECRET
@@ -94,6 +234,9 @@ modules:
94234 - ' [ "$TEST_SECRET" == "test123" ]'
95235
96236 - type : script
237+ if :
238+ host-env :
239+ exists : TEST_SECRET
97240 secrets :
98241 - type : env
99242 name : TEST_SECRET
@@ -104,6 +247,9 @@ modules:
104247 - ' [ "$(cat /tmp/test-secret)" == "test123" ]'
105248
106249 - type : script
250+ if :
251+ host-file :
252+ exists : ./secrets/test-secret
107253 secrets :
108254 - type : file
109255 source : ./secrets/test-secret
@@ -114,6 +260,9 @@ modules:
114260 - ' [ "$(cat /tmp/test-secret)" == "321tset" ]'
115261
116262 - type : script
263+ if :
264+ host-file :
265+ exists : ./secrets/test-secret
117266 secrets :
118267 - type : file
119268 source : ./secrets/test-secret
@@ -124,6 +273,9 @@ modules:
124273 - ' [ "$TEST_SECRET" == "321tset" ]'
125274
126275 - type : script
276+ if :
277+ host-file :
278+ exists : ./test_secret_file.txt
127279 secrets :
128280 - type : exec
129281 command : cat
@@ -136,6 +288,9 @@ modules:
136288 - ' [ "$TEST_SECRET" == "TEST_PASS" ]'
137289
138290 - type : script
291+ if :
292+ host-file :
293+ exists : ./test_secret_file.txt
139294 secrets :
140295 - type : exec
141296 command : cat
0 commit comments