Commit 6bb8f6b9 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Pull docker image in case it does not exist

parent e51c278a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ workflow:
variables:
  LOGFILE_OPENAPI: "openapi-validation.log"
  GIT_CLEAN_FLAGS: -ffdxq
  SWAGGER_DOCKER_IMG: "etsiforge/swagger-cli:4.0.3"

stages:
  - validation
@@ -29,9 +30,10 @@ Validate OpenAPI:
    - |
     curl "${CI_API_V4_URL}/projects/$TOOLS_3GPP_SCRIPTS_PROJECT_ID/repository/files/all%2Fvalidate-all-in-docker%2Esh/raw?ref=master" >> validate-all-in-docker.sh
    - chmod +x validate-all-in-docker.sh
    - docker pull -q "${SWAGGER_DOCKER_IMG}"
  script:
    - echo 'Validate OpenAPI'
    - docker run --rm -v $(pwd):"/specs" etsiforge/swagger-cli:4.0.3 /bin/sh -c "sh specs/validate-all-in-docker.sh"
    - docker run --rm -v $(pwd):"/specs" ${SWAGGER_DOCKER_IMG} /bin/sh -c "sh specs/validate-all-in-docker.sh"
  artifacts:
    name: "$CI_JOB_NAME"
    when: always
+2 −2
Original line number Diff line number Diff line
@@ -26,11 +26,11 @@ if [ ! $found_data_models ] ; then
fi

echo "------ pyYANG Version ------"
#  Display all  errors and warnings to the user. Errors are allowed.
docker pull -q "${DOCKER_IMG}"
docker run --rm -v $(pwd)/yang-models:/yang "${DOCKER_IMG}" pyang --version

echo "------ Linting modified YANG files ------"
#  Display all  errors and warnings to the user. Errors are allowed.
docker pull -q "${DOCKER_IMG}"
# Linting only yang files that have changed in last commit
files_changed=`git log --raw -n 1 |grep "^:.*yang-models/.*yang"| cut -d '/' -f 2`
echo $files_changed