64 lines
1.3 KiB
YAML
64 lines
1.3 KiB
YAML
stages:
|
|
- quality assurance
|
|
- build
|
|
- deploy
|
|
|
|
.init_venv: &init_venv
|
|
- python -m venv .venv
|
|
- source .venv/bin/activate
|
|
- python --version
|
|
- echo "venv '$VIRTUAL_ENV'"
|
|
|
|
.install_package: &install_package
|
|
- pip install -e . -q
|
|
- python -m pip list --format=columns --disable-pip-version-check
|
|
|
|
backend-pylint:
|
|
stage: quality assurance
|
|
image: python:3.11.0
|
|
before_script:
|
|
- mkdir -p public
|
|
- cd backend
|
|
- *init_venv
|
|
- *install_package
|
|
- pip install pylint~=2.17.7 pylint-gitlab --disable-pip-version-check -q
|
|
- pylint --version
|
|
script:
|
|
- pylint **/*.py --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter > ../codeclimate.json
|
|
- pylint **/*.py --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter > ../public/index.html
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
reports:
|
|
codequality: codeclimate.json
|
|
when: always
|
|
|
|
build:package:
|
|
stage: build
|
|
needs: [ "backend-pylint" ]
|
|
image: python:3.11.0
|
|
before_script:
|
|
- cd backend
|
|
- *init_venv
|
|
- pip install build
|
|
script:
|
|
- python -m build
|
|
- cp dist ../dist -r
|
|
artifacts:
|
|
paths:
|
|
- dist
|
|
when: always
|
|
|
|
pages:
|
|
stage: deploy
|
|
needs: [ "backend-pylint" ]
|
|
image: alpine:latest
|
|
script:
|
|
- echo "Deployed!"
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
only:
|
|
refs:
|
|
- main
|