Commit b6697795 authored by carignani's avatar carignani
Browse files

fix committer email and filename for docker validation

parent 49e60be5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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}"
		}
+13 −7
Original line number Diff line number Diff line
@@ -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
@@ -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=$?
@@ -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 
@@ -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 ----"
@@ -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