dda-devops-build/.gitlab-ci.yml

65 lines
1.7 KiB
YAML
Raw Normal View History

2023-03-31 10:57:35 +00:00
image: "python:3.10"
2022-02-22 17:01:08 +00:00
before_script:
- python --version
2022-02-24 14:47:14 +00:00
- python -m pip install --upgrade pip
2022-02-24 09:05:58 +00:00
- pip install -r requirements.txt
2023-05-20 09:48:49 +00:00
- export IMAGE_TAG=$CI_IMAGE_TAG
2023-05-20 11:47:33 +00:00
- export IMAGE_DOCKERHUB_USER=$DOCKERHUB_USER
2023-05-20 09:48:49 +00:00
- export IMAGE_DOCKERHUB_PASSWORD=$DOCKERHUB_PASSWORD
2022-02-22 17:01:08 +00:00
stages:
2022-12-30 13:05:15 +00:00
- lint&test
2022-02-22 17:01:08 +00:00
- upload
2022-05-20 11:37:48 +00:00
- image
2022-02-22 17:01:08 +00:00
flake8:
2022-12-30 13:05:15 +00:00
stage: lint&test
2022-02-22 17:01:08 +00:00
script:
2022-02-24 15:06:56 +00:00
- pip install -r dev_requirements.txt
2023-04-21 11:51:05 +00:00
- flake8 --max-line-length=120 --count --select=E9,F63,F7,F82 --show-source --statistics src/main/python/ddadevops/
- flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics src/main/python/ddadevops/
2022-02-22 17:01:08 +00:00
mypy:
2022-12-30 13:05:15 +00:00
stage: lint&test
2022-02-22 17:01:08 +00:00
script:
2022-02-24 15:06:56 +00:00
- pip install -r dev_requirements.txt
2023-04-21 11:51:05 +00:00
- python -m mypy src/main/python/ddadevops/ --ignore-missing-imports
2022-02-22 17:01:08 +00:00
pylint:
2022-12-30 13:05:15 +00:00
stage: lint&test
2022-02-22 17:01:08 +00:00
script:
2022-02-24 15:06:56 +00:00
- pip install -r dev_requirements.txt
2023-05-05 06:54:21 +00:00
- pylint -d W0511,R0903,C0301,W0614,C0114,C0115,C0116,similarities,W1203,W0702,W0702,R0913,R0902,R0914,R1732 src/main/python/ddadevops/
2022-12-30 13:05:15 +00:00
pytest:
stage: lint&test
script:
- pip install -r dev_requirements.txt
- pytest
2022-02-22 17:01:08 +00:00
pypi-stable:
stage: upload
rules:
2022-02-24 09:25:13 +00:00
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
2022-02-24 15:38:18 +00:00
- if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/'
2022-02-22 17:01:08 +00:00
script:
2022-03-29 17:13:02 +00:00
- pyb -P version=$CI_COMMIT_TAG publish upload
2022-05-20 08:01:53 +00:00
clojure-image-test-publish:
2022-05-20 13:07:06 +00:00
image: domaindrivenarchitecture/devops-build:latest
2022-05-20 08:01:53 +00:00
stage: image
2022-05-20 13:07:06 +00:00
rules:
- if: '$CI_COMMIT_TAG != null'
2022-05-20 08:01:53 +00:00
script:
- cd infrastructure/clojure && pyb image test publish
devops-build-image-test-publish:
2022-05-20 13:07:06 +00:00
image: domaindrivenarchitecture/devops-build:latest
2022-05-20 08:01:53 +00:00
stage: image
2022-05-20 13:07:06 +00:00
rules:
- if: '$CI_COMMIT_TAG != null'
2022-05-20 08:01:53 +00:00
script:
- cd infrastructure/devops-build && pyb image test publish