Loading Jenkinsfile +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ pipeline { mail to: 'cti_support@etsi.org', subject: "Failed Pipeline: ${currentBuild.fullDisplayName}", body: "Something is wrong with ${env.BUILD_URL}" mail to: 'gitlabUserEmail', mail to: "${env.gitlabUserEmail}", subject: "[3GPP Forge] Validaiton failed: ${currentBuild.fullDisplayName}", body: "Some validation errors were found in your contribution to 3GPP Forge. Review at ${env.BUILD_URL}" } Loading validate-all.sh +13 −7 Original line number Diff line number Diff line Loading @@ -19,8 +19,10 @@ else fi function validate { echo -e "---- Validating $i: " if [ $RUN_IN_DOCKER == 0 ] ; then docker run --rm -v "$PWD/$1":"/$1" $DOCKER_IMAGE swagger-cli validate "$1" bname=$(basename "$1") docker run --rm -v $(dirname $(realpath $1)):"/specs" $DOCKER_IMAGE swagger-cli validate "/specs/$bname" else swagger-cli validate "$1" fi Loading @@ -29,10 +31,7 @@ function validate { echo -e "\n------ Switching to $1 folder --------" cd $1 echo -e "\n------ Content of the folder ------" ls echo -e "\n------ Validating all YAML files ------" echo -e "\n------ Validating all YAML files (may takes several minutes) ------" # If there are no YAML file, simply exit ls | grep -q yaml found_yaml=$? Loading @@ -45,7 +44,7 @@ fres=0 LOG="" ERR="" for i in ./*.yaml ; do echo "---- Will validate: $i ----" MSG=$(validate "$i" 2>&1) res=$? if [ ! $res == 0 ] ; then Loading @@ -56,7 +55,11 @@ for i in ./*.yaml ; do done echo -e "\n-- Final validator returns $fres." if [ $fres == 0 ] ; then echo "No errors found, all files validate the OpenAPI definition. Below the complete log." else echo "Some errors found, see below the details." fi if [ ! "$ERR" == "" ] ; then echo -e "\n---- Errors detected ----" Loading @@ -66,6 +69,9 @@ fi echo -e "\n---- Complete log of validation ----" echo -e $LOG echo -e "\n------ Content of the folder ------" ls # Exit code needed for jenkins to know the verdict of the build exit $fres Loading
Jenkinsfile +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ pipeline { mail to: 'cti_support@etsi.org', subject: "Failed Pipeline: ${currentBuild.fullDisplayName}", body: "Something is wrong with ${env.BUILD_URL}" mail to: 'gitlabUserEmail', mail to: "${env.gitlabUserEmail}", subject: "[3GPP Forge] Validaiton failed: ${currentBuild.fullDisplayName}", body: "Some validation errors were found in your contribution to 3GPP Forge. Review at ${env.BUILD_URL}" } Loading
validate-all.sh +13 −7 Original line number Diff line number Diff line Loading @@ -19,8 +19,10 @@ else fi function validate { echo -e "---- Validating $i: " if [ $RUN_IN_DOCKER == 0 ] ; then docker run --rm -v "$PWD/$1":"/$1" $DOCKER_IMAGE swagger-cli validate "$1" bname=$(basename "$1") docker run --rm -v $(dirname $(realpath $1)):"/specs" $DOCKER_IMAGE swagger-cli validate "/specs/$bname" else swagger-cli validate "$1" fi Loading @@ -29,10 +31,7 @@ function validate { echo -e "\n------ Switching to $1 folder --------" cd $1 echo -e "\n------ Content of the folder ------" ls echo -e "\n------ Validating all YAML files ------" echo -e "\n------ Validating all YAML files (may takes several minutes) ------" # If there are no YAML file, simply exit ls | grep -q yaml found_yaml=$? Loading @@ -45,7 +44,7 @@ fres=0 LOG="" ERR="" for i in ./*.yaml ; do echo "---- Will validate: $i ----" MSG=$(validate "$i" 2>&1) res=$? if [ ! $res == 0 ] ; then Loading @@ -56,7 +55,11 @@ for i in ./*.yaml ; do done echo -e "\n-- Final validator returns $fres." if [ $fres == 0 ] ; then echo "No errors found, all files validate the OpenAPI definition. Below the complete log." else echo "Some errors found, see below the details." fi if [ ! "$ERR" == "" ] ; then echo -e "\n---- Errors detected ----" Loading @@ -66,6 +69,9 @@ fi echo -e "\n---- Complete log of validation ----" echo -e $LOG echo -e "\n------ Content of the folder ------" ls # Exit code needed for jenkins to know the verdict of the build exit $fres