Loading common/.gitlab-ci-common.yml +21 −6 Original line number Diff line number Diff line Loading @@ -20,11 +20,14 @@ Validate OpenAPIs: stage: validation script: - echo 'Validate OpenAPIs' - docker run -v "$(pwd)":/work -u $(id -u):$(id -g) openapivalidator "/work" "/storage" "$filter" - docker run --rm -v "$(pwd)":/work -u $(id -u):$(id -g) openapivalidator "/work" "/storage" "$filter" artifacts: when: on_success paths: - build/* rules: - if: $CLEAN_WEB_PAGES == "false" when: always pages: stage: publish Loading @@ -37,13 +40,25 @@ pages: - if [ -e "content.zip" ]; then unzip "content.zip"; rm "content.zip"; fi - set -e # Add/update content - mkdir -p "public/$CI_COMMIT_REF_NAME" - cp -r -f build/* public/$CI_COMMIT_REF_NAME - if [[ -n "$CI_COMMIT_TAG" ]]; then mkdir -p "public/$CI_COMMIT_TAG"; cp -r -f build/* public/$CI_COMMIT_TAG; fi - if [ "$CLEAN_WEB_PAGES" != "false" ]; then echo "Removing folder $CLEAN_WEB_PAGES..."; rm -r public/$CLEAN_WEB_PAGES; fi # Remove all pdf files - rm -f public/*/*.pdf # Zip the content and publish the zip again - zip -r "content.zip" "public" - mv "content.zip" "public/" - du -h public/ artifacts: paths: - public only: - tags No newline at end of file rules: # Job executed when creating a tag - if: $CI_COMMIT_TAG when: always # Job executed when creating an official tag (in case needed) #- if: $CI_COMMIT_TAG =~ /v\d(\.\d){2}$/ # when: always # Job executed when CLEAN_WEB_PAGES is not false, to remove obsolete/unnecessary tags - if: $CLEAN_WEB_PAGES != "false" when: always No newline at end of file common/scripts/validate-in-docker.sh +4 −4 Original line number Diff line number Diff line Loading @@ -27,9 +27,9 @@ function validate_api () { yaml2json "${merged_file}" > "${json_file}" # Create the PDF version echo "--- Create PDF..." oas2pdf "${json_file}" 2>/dev/null 1>/dev/null mv "${deliverable}-${api}-API.pdf" "../build/" #echo "--- Create PDF..." #oas2pdf "${json_file}" 2>/dev/null 1>/dev/null #mv "${deliverable}-${api}-API.pdf" "../build/" echo "--- Validating ${merged_file}" swagger-cli validate "${merged_file}" Loading @@ -39,7 +39,7 @@ function validate_api () { # If validation succedes, store the generated file [ $vres -a -d "/storage" ] && store_api "${merged_file}" [ $vres -a -d "/storage" ] && store_api "${json_file}" [ $vres -a -d "/storage" ] && store_api "../build/${deliverable}-${api}-API.pdf" #[ $vres -a -d "/storage" ] && store_api "../build/${deliverable}-${api}-API.pdf" return $vres Loading Loading
common/.gitlab-ci-common.yml +21 −6 Original line number Diff line number Diff line Loading @@ -20,11 +20,14 @@ Validate OpenAPIs: stage: validation script: - echo 'Validate OpenAPIs' - docker run -v "$(pwd)":/work -u $(id -u):$(id -g) openapivalidator "/work" "/storage" "$filter" - docker run --rm -v "$(pwd)":/work -u $(id -u):$(id -g) openapivalidator "/work" "/storage" "$filter" artifacts: when: on_success paths: - build/* rules: - if: $CLEAN_WEB_PAGES == "false" when: always pages: stage: publish Loading @@ -37,13 +40,25 @@ pages: - if [ -e "content.zip" ]; then unzip "content.zip"; rm "content.zip"; fi - set -e # Add/update content - mkdir -p "public/$CI_COMMIT_REF_NAME" - cp -r -f build/* public/$CI_COMMIT_REF_NAME - if [[ -n "$CI_COMMIT_TAG" ]]; then mkdir -p "public/$CI_COMMIT_TAG"; cp -r -f build/* public/$CI_COMMIT_TAG; fi - if [ "$CLEAN_WEB_PAGES" != "false" ]; then echo "Removing folder $CLEAN_WEB_PAGES..."; rm -r public/$CLEAN_WEB_PAGES; fi # Remove all pdf files - rm -f public/*/*.pdf # Zip the content and publish the zip again - zip -r "content.zip" "public" - mv "content.zip" "public/" - du -h public/ artifacts: paths: - public only: - tags No newline at end of file rules: # Job executed when creating a tag - if: $CI_COMMIT_TAG when: always # Job executed when creating an official tag (in case needed) #- if: $CI_COMMIT_TAG =~ /v\d(\.\d){2}$/ # when: always # Job executed when CLEAN_WEB_PAGES is not false, to remove obsolete/unnecessary tags - if: $CLEAN_WEB_PAGES != "false" when: always No newline at end of file
common/scripts/validate-in-docker.sh +4 −4 Original line number Diff line number Diff line Loading @@ -27,9 +27,9 @@ function validate_api () { yaml2json "${merged_file}" > "${json_file}" # Create the PDF version echo "--- Create PDF..." oas2pdf "${json_file}" 2>/dev/null 1>/dev/null mv "${deliverable}-${api}-API.pdf" "../build/" #echo "--- Create PDF..." #oas2pdf "${json_file}" 2>/dev/null 1>/dev/null #mv "${deliverable}-${api}-API.pdf" "../build/" echo "--- Validating ${merged_file}" swagger-cli validate "${merged_file}" Loading @@ -39,7 +39,7 @@ function validate_api () { # If validation succedes, store the generated file [ $vres -a -d "/storage" ] && store_api "${merged_file}" [ $vres -a -d "/storage" ] && store_api "${json_file}" [ $vres -a -d "/storage" ] && store_api "../build/${deliverable}-${api}-API.pdf" #[ $vres -a -d "/storage" ] && store_api "../build/${deliverable}-${api}-API.pdf" return $vres Loading