2023-09-26 20:01:25 +00:00
|
|
|
stages:
|
|
|
|
- quality assurance
|
2023-11-24 19:50:18 +00:00
|
|
|
- build
|
2023-10-01 20:27:16 +00:00
|
|
|
- deploy
|
2023-09-26 20:01:25 +00:00
|
|
|
|
2023-10-01 17:54:06 +00:00
|
|
|
.init_venv: &init_venv
|
|
|
|
- python -m venv .venv
|
|
|
|
- source .venv/bin/activate
|
|
|
|
- python --version
|
|
|
|
- echo "venv '$VIRTUAL_ENV'"
|
|
|
|
|
2023-11-24 19:50:18 +00:00
|
|
|
.install_package: &install_package
|
|
|
|
- pip install -e . -q
|
2023-10-01 17:54:06 +00:00
|
|
|
- python -m pip list --format=columns --disable-pip-version-check
|
|
|
|
|
2023-09-26 20:54:40 +00:00
|
|
|
backend-pylint:
|
2023-09-26 20:01:25 +00:00
|
|
|
stage: quality assurance
|
2023-11-24 19:50:18 +00:00
|
|
|
image: python:3.11.0
|
2023-09-26 20:01:25 +00:00
|
|
|
before_script:
|
2023-10-01 20:27:16 +00:00
|
|
|
- mkdir -p public
|
2023-09-26 20:01:25 +00:00
|
|
|
- cd backend
|
2023-10-01 17:54:06 +00:00
|
|
|
- *init_venv
|
2023-11-24 19:50:18 +00:00
|
|
|
- *install_package
|
2023-10-03 16:27:39 +00:00
|
|
|
- pip install pylint~=2.17.7 pylint-gitlab --disable-pip-version-check -q
|
2023-10-01 17:54:06 +00:00
|
|
|
- pylint --version
|
2023-09-26 20:01:25 +00:00
|
|
|
script:
|
2023-11-24 19:50:18 +00:00
|
|
|
- pylint **/*.py --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter > ../codeclimate.json
|
|
|
|
- pylint **/*.py --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter > ../public/index.html
|
2023-10-01 20:16:28 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
reports:
|
|
|
|
codequality: codeclimate.json
|
|
|
|
when: always
|
2023-10-01 20:27:16 +00:00
|
|
|
|
2023-11-24 19:50:18 +00:00
|
|
|
build:package:
|
|
|
|
stage: build
|
|
|
|
needs: [ "backend-pylint" ]
|
|
|
|
image: python:3.11.0
|
|
|
|
before_script:
|
|
|
|
- cd backend
|
|
|
|
- *init_venv
|
|
|
|
- pip install build
|
|
|
|
script:
|
2023-11-24 19:52:19 +00:00
|
|
|
- python -m build
|
2023-11-24 19:56:53 +00:00
|
|
|
- cp dist ../dist -r
|
2023-11-24 19:50:18 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist
|
|
|
|
when: always
|
|
|
|
|
2023-10-01 20:27:16 +00:00
|
|
|
pages:
|
|
|
|
stage: deploy
|
2023-11-24 19:50:18 +00:00
|
|
|
needs: [ "backend-pylint" ]
|
2023-10-01 20:27:16 +00:00
|
|
|
image: alpine:latest
|
|
|
|
script:
|
|
|
|
- echo "Deployed!"
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- main
|