Skip to content
Snippets Groups Projects
Commit 40e350b0 authored by David Trattnig's avatar David Trattnig
Browse files

Build Swagger UI docs.

parent 5d555639
No related branches found
No related tags found
No related merge requests found
image: alpine:latest
stages:
- bundle
- deploy
variables:
API_ROOT_FILE: ./src/swagger/swagger.yaml
BUNDLED_JSON_FILE: ./public/api.json
cache:
paths:
- ./node_modules
bundle_and_test:
stage: bundle
before_script:
- apk add --update npm
- npm install -g @apidevtools/swagger-cli
script:
- mkdir public
- swagger-cli bundle -t json $API_ROOT_FILE > $BUNDLED_JSON_FILE
- swagger-cli validate $BUNDLED_JSON_FILE
artifacts:
paths:
- public
expire_in: 2 days
only:
- develop
pages:
stage: deploy
before_script:
- apk add --update npm
- npm install swagger-ui-dist@3.22.1
script:
- cp -rp node_modules/swagger-ui-dist/* ./public
- 'sed -i "s@.*url.*@url: \"api.json\",@" ./public/index.html'
artifacts:
paths:
- public
expire_in: 2 days
only:
- develop
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment