Loading sa5/.gitlab-ci.yml +10 −9 Original line number Diff line number Diff line # CI/CD: # # RESOLVE triggered by: # - any (branch commit) # VALIDATION triggered by: # - any (branch commit) # Loading @@ -25,7 +23,7 @@ stages: - validation - generation YANG Strict: YANG Validation Strict: stage: validation before_script: - | Loading @@ -35,12 +33,13 @@ YANG Strict: - echo 'YANG Strict' - ./validate-data-models.sh . artifacts: name: "YANG strict validation result" name: "YANG validation strict result" when: always paths: - ${LOGFILE_YANG} - yang-validation.log expose_as: 'YANG validation strict result' YANG 3GPP Checks: YANG Additional 3GPP Checks: stage: validation allow_failure: true before_script: Loading @@ -51,10 +50,11 @@ YANG 3GPP Checks: - echo 'YANG 3GPP Checks' - ./lint-data-models.sh . artifacts: name: "YANG 3gpp style check result" name: "YANG Additional 3GPP checks result" when: always paths: - ${LOGFILE_LINT} - yang-linting.log expose_as: 'YANG Additional 3GPP checks result' Validate OpenAPI: stage: validation Loading @@ -69,7 +69,8 @@ Validate OpenAPI: name: "OpenAPI validation result" when: always paths: - ./OpenAPI/${LOGFILE_OPENAPI} - OpenAPI/openapi-validation.log expose_as: 'OpenAPI validation result' Word CR text: stage: generation Loading sa5/lint-data-models.sh +2 −1 Original line number Diff line number Diff line Loading @@ -73,11 +73,12 @@ echo $ret if [ $ret == 1 ] ; then echo "Some issues were collected by the linter, but they are treated as warnings and are not failing the validation." echo "To see the full output of the linter, download the archived artifact named '$LOGFILE'." fi if [ ! -s $LOGFILE ] ;then rm "$LOGFILE" else echo "To see the full output of the linter, download the archived artifact named '$LOGFILE'." fi exit $ret Loading sa5/validate-all.sh +10 −8 Original line number Diff line number Diff line Loading @@ -64,24 +64,26 @@ done echo -e "\n-- Final validator returns $fres." | tee -a $LOGFILE if [ $fres == 0 ] ; then echo "No errors found, all files validate the OpenAPI definition. Below the complete log." | tee -a $LOGFILE echo "No errors found, all files validate the OpenAPI definition" | tee -a $LOGFILE else echo "Some errors found, see below the details." | tee -a $LOGFILE echo "Some errors found by the OpenAPI validation" | tee -a $LOGFILE fi if [ ! "$ERR" == "" ] ; then echo -e "\n---- Errors detected ----" | tee -a $LOGFILE echo -e $ERR | tee -a $LOGFILE echo -e "\n---- Errors detected ----" >> $LOGFILE echo -e $ERR >> $LOGFILE fi echo -e "\n---- Complete log of validation ----" | tee -a $LOGFILE echo -e $LOG | tee -a $LOGFILE echo -e "\n---- Complete log of validation ----" >> $LOGFILE echo -e $LOG >> $LOGFILE echo -e "\n------ Content of the folder ------" | tee -a $LOGFILE ls | tee -a $LOGFILE echo -e "\n------ Content of the folder ------" >> $LOGFILE ls >> $LOGFILE if [ ! -s $LOGFILE ] ;then rm "$LOGFILE" else echo "To see the full output of the OpenAPI validation, download the archived artifact named '$LOGFILE'." fi # Exit code needed for jenkins to know the verdict of the build Loading sa5/validate-data-models.sh +4 −2 Original line number Diff line number Diff line Loading @@ -31,14 +31,16 @@ docker pull -q "${DOCKER_IMG}" docker run --rm -v $(pwd)/yang-models:/yang "${DOCKER_IMG}" "/bin/sh" -c 'pyang --strict -p external-yams *.yang' 2>>$LOGFILE >>$LOGFILE ret=$? cat $LOGFILE if [ $ret == 0 ] ; then echo "No errors found by pyang --strict validation." else echo "Some issues were collected by pyang --strict validation." fi if [ ! -s $LOGFILE ] ;then rm "$LOGFILE" else echo "To see the full output of the validation, download the archived artifact named '$LOGFILE'." fi exit $ret Loading Loading
sa5/.gitlab-ci.yml +10 −9 Original line number Diff line number Diff line # CI/CD: # # RESOLVE triggered by: # - any (branch commit) # VALIDATION triggered by: # - any (branch commit) # Loading @@ -25,7 +23,7 @@ stages: - validation - generation YANG Strict: YANG Validation Strict: stage: validation before_script: - | Loading @@ -35,12 +33,13 @@ YANG Strict: - echo 'YANG Strict' - ./validate-data-models.sh . artifacts: name: "YANG strict validation result" name: "YANG validation strict result" when: always paths: - ${LOGFILE_YANG} - yang-validation.log expose_as: 'YANG validation strict result' YANG 3GPP Checks: YANG Additional 3GPP Checks: stage: validation allow_failure: true before_script: Loading @@ -51,10 +50,11 @@ YANG 3GPP Checks: - echo 'YANG 3GPP Checks' - ./lint-data-models.sh . artifacts: name: "YANG 3gpp style check result" name: "YANG Additional 3GPP checks result" when: always paths: - ${LOGFILE_LINT} - yang-linting.log expose_as: 'YANG Additional 3GPP checks result' Validate OpenAPI: stage: validation Loading @@ -69,7 +69,8 @@ Validate OpenAPI: name: "OpenAPI validation result" when: always paths: - ./OpenAPI/${LOGFILE_OPENAPI} - OpenAPI/openapi-validation.log expose_as: 'OpenAPI validation result' Word CR text: stage: generation Loading
sa5/lint-data-models.sh +2 −1 Original line number Diff line number Diff line Loading @@ -73,11 +73,12 @@ echo $ret if [ $ret == 1 ] ; then echo "Some issues were collected by the linter, but they are treated as warnings and are not failing the validation." echo "To see the full output of the linter, download the archived artifact named '$LOGFILE'." fi if [ ! -s $LOGFILE ] ;then rm "$LOGFILE" else echo "To see the full output of the linter, download the archived artifact named '$LOGFILE'." fi exit $ret Loading
sa5/validate-all.sh +10 −8 Original line number Diff line number Diff line Loading @@ -64,24 +64,26 @@ done echo -e "\n-- Final validator returns $fres." | tee -a $LOGFILE if [ $fres == 0 ] ; then echo "No errors found, all files validate the OpenAPI definition. Below the complete log." | tee -a $LOGFILE echo "No errors found, all files validate the OpenAPI definition" | tee -a $LOGFILE else echo "Some errors found, see below the details." | tee -a $LOGFILE echo "Some errors found by the OpenAPI validation" | tee -a $LOGFILE fi if [ ! "$ERR" == "" ] ; then echo -e "\n---- Errors detected ----" | tee -a $LOGFILE echo -e $ERR | tee -a $LOGFILE echo -e "\n---- Errors detected ----" >> $LOGFILE echo -e $ERR >> $LOGFILE fi echo -e "\n---- Complete log of validation ----" | tee -a $LOGFILE echo -e $LOG | tee -a $LOGFILE echo -e "\n---- Complete log of validation ----" >> $LOGFILE echo -e $LOG >> $LOGFILE echo -e "\n------ Content of the folder ------" | tee -a $LOGFILE ls | tee -a $LOGFILE echo -e "\n------ Content of the folder ------" >> $LOGFILE ls >> $LOGFILE if [ ! -s $LOGFILE ] ;then rm "$LOGFILE" else echo "To see the full output of the OpenAPI validation, download the archived artifact named '$LOGFILE'." fi # Exit code needed for jenkins to know the verdict of the build Loading
sa5/validate-data-models.sh +4 −2 Original line number Diff line number Diff line Loading @@ -31,14 +31,16 @@ docker pull -q "${DOCKER_IMG}" docker run --rm -v $(pwd)/yang-models:/yang "${DOCKER_IMG}" "/bin/sh" -c 'pyang --strict -p external-yams *.yang' 2>>$LOGFILE >>$LOGFILE ret=$? cat $LOGFILE if [ $ret == 0 ] ; then echo "No errors found by pyang --strict validation." else echo "Some issues were collected by pyang --strict validation." fi if [ ! -s $LOGFILE ] ;then rm "$LOGFILE" else echo "To see the full output of the validation, download the archived artifact named '$LOGFILE'." fi exit $ret Loading