-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
55 lines (46 loc) · 1.55 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
image: docker.siemens.com/code-ops/poetry-docker
variables:
http_proxy: $CODE_PROXY
https_proxy: $CODE_PROXY
no_proxy: .siemens.com
REGISTRY_URL: https://code.siemens.com/api/v4/projects/${CI_PROJECT_ID}/packages
stages:
- check
- deploy
cache:
paths:
- .venv
key: "${CI_COMMIT_REF_SLUG}"
format_and_style_python:
stage: check
script:
- poetry config virtualenvs.in-project true
- poetry install --no-root
# - poetry run isort --skip .venv cli test
# - poetry run black --exclude=.venv cli test
- poetry run flake8 --exclude=.venv cli test
format_and_style_markdown:
image: node:erbium
stage: check
script:
- npx -q markdownlint-cli *.md
.package_gitlab_base:
stage: deploy
before_script:
- poetry install --no-root
- poetry config repositories.code ${REGISTRY_URL}/pypi/
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' # only on "master" branch (or "main" in future)
package_gitlab_dev:
extends: .package_gitlab_base
script:
- poetry run python3 publish-dev-prepare.py
- poetry publish --repository code --build --username gitlab-ci-token --password ${CI_JOB_TOKEN}
package_gitlab:
extends: .package_gitlab_base
script:
- poetry publish --repository code --build --username gitlab-ci-token --password ${CI_JOB_TOKEN}
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' # only on "master" branch (or "main" in future)
when: manual
allow_failure: true