Skip to content
Snippets Groups Projects
Commit a3ab02bf authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

CI: add autogenerated openapi.yaml file

The CI should now automatically build an openapi.yaml file of the API
schema that is stored as an artifact.
parent 2f71e281
No related branches found
No related tags found
1 merge request!21Add API documentation
Pipeline #1709 passed
......@@ -7,8 +7,29 @@
- Dockerfile
stages:
- build
- release
build-openapi-scheme:
stage: build
image: python:3.9-alpine
variables:
SECRET_KEY: not-a-very-secret-key
DJANGO_SETTINGS_MODULE: steering.settings
# steering.settings switches to sqlite if the VIRTUAL_ENV environment
# variable is present. It’s probably a good idea to refactor this to
# something more explicit.
VIRTUAL_ENV: 1
before_script:
- apk add gcc musl-dev zlib-dev jpeg-dev libmagic
- pip install -r requirements.txt
script:
- python3 -m django spectacular --validate --lang en --file openapi.yaml
artifacts:
paths:
- openapi.yaml
docker-push:
# Use the official docker image.
image: docker:latest
......@@ -32,16 +53,16 @@ docker-push:
fi
# TODO: maybe isolate docker build and docker push
- docker push "$AURA_IMAGE_NAME" --all-tags
rules:
rules:
- *release-rules
# every commit on master/main branch should trigger a push to docker-hub as unstable without a release
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
exists:
- Dockerfile
release_job:
stage: release
needs:
needs:
- docker-push
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules: *release-rules
......
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