diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 479d30835fc8d3a306e435f098928db0e4e8f835..5ce2cb1ee90e9219a2d70e70b9d43b2a59b2981e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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