.jenkins.sh 376 Bytes
Newer Older
1 2
#!/bin/bash

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

fres=0
for i in $specfiles ; do
7 8 9 10 11 12 13
    echo "-- Validating and linting OpenAPI file $i..."
    swagger-cli validate "$i"
    res=$?
    speccy lint "$i"
    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