-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcli-test.sh
executable file
·39 lines (35 loc) · 1.15 KB
/
cli-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env sh
set -eu
LINTER=./dist/lagoon-linter_linux_amd64_v1/lagoon-linter
chmod +x "$LINTER"
# profile: required
for lagoonyml in ./internal/lagoonyml/required/testdata/valid.*.yml; do
echo "$lagoonyml"
rm -f .lagoon.yml
$LINTER validate --lagoon-yaml="$lagoonyml" # explicitly validate $lagoonyml
ln -fs "$lagoonyml" .lagoon.yml
$LINTER # implicitly validate .lagoon.yml
done
for lagoonyml in ./internal/lagoonyml/required/testdata/invalid.*.yml; do
echo "$lagoonyml"
rm -f .lagoon.yml
$LINTER validate --lagoon-yaml="$lagoonyml" && exit 1
ln -fs "$lagoonyml" .lagoon.yml
$LINTER && exit 1
done
# profile: deprecated
for lagoonyml in ./internal/lagoonyml/deprecated/testdata/valid.*.yml; do
echo "$lagoonyml"
rm -f .lagoon.yml
$LINTER validate --profile=deprecated --lagoon-yaml="$lagoonyml"
ln -fs "$lagoonyml" .lagoon.yml
$LINTER validate --profile=deprecated
done
for lagoonyml in ./internal/lagoonyml/deprecated/testdata/invalid.*.yml; do
echo "$lagoonyml"
rm -f .lagoon.yml
$LINTER validate --profile=deprecated --lagoon-yaml="$lagoonyml" && exit 1
ln -fs "$lagoonyml" .lagoon.yml
$LINTER validate --profile=deprecated && exit 1
done
exit 0