.jenkins.sh 380 Bytes
Newer Older
1 2 3 4 5 6
#!/bin/bash

specfiles=$(ls | egrep "^[^.]*Api.(json|yaml)")

fres=0
for i in $specfiles ; do
Michele Carignani's avatar
Michele Carignani committed
7 8
    echo "-- Validating and linting OpenAPI file $i..."
    swagger-cli validate "$i"
9
    res=$?
Michele Carignani's avatar
Michele Carignani committed
10
    speccy lint "$i"
11 12 13
    res2=$?
    fres=$(($fres||$res||$res2))
    echo "--- Validator returned $res, linter returned $res2."
14 15
done

16
echo "-- Final validation returns $fres."
17

18
exit $fres