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

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

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

echo "-- Final validator returns $fres."
exit $fres
18