Correctly added jenkins.sh 34/234/1
authorfeatherstone <walter.featherstone@viavisolutions.com>
Mon, 22 Jan 2018 14:04:41 +0000 (14:04 +0000)
committerfeatherstone <walter.featherstone@viavisolutions.com>
Mon, 22 Jan 2018 14:04:41 +0000 (14:04 +0000)
Change-Id: I2170f42ca4f17e52813bd557d1ec48c6bf86f164
Signed-off-by: featherstone <walter.featherstone@viavisolutions.com>
.jenkins.sh [new file with mode: 0644]

diff --git a/.jenkins.sh b/.jenkins.sh
new file mode 100644 (file)
index 0000000..e68170a
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+specfiles=$(ls | egrep "^[^.]*API.(json|yaml)")
+
+fres=0
+for i in $specfiles ; do
+    echo "-- Validating OpenAPI file $i..."
+    swagger-tools validate $i
+    res=$?
+    fres=$(($fres||$res))
+    echo -e "-- Validator returned $res.\n"
+done
+
+echo "-- Final validator returns $fres."
+read -p "Press [Enter] key to continue..."
+!exit $fres