-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
93 lines (83 loc) · 1.77 KB
/
.gitlab-ci.yml
File metadata and controls
93 lines (83 loc) · 1.77 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
default:
image: python:3.10
tags:
- docker
- ubuntu
include:
- project: "infra/ci-templates"
ref: "master"
file:
- rules.yml
- vault_auth.yml
- build.yml
- deploy_k8s.yml
- deploy_k8s/envs/deploy_kubesolo_k8s.yml
- deploy_k8s/envs/deploy_aws_k8s.yml
stages:
- test
- build
- publish
- deploy
test:
stage: test
rules:
- when: manual
before_script:
- pip install --upgrade pip
- pip install .[dev]
script:
- pre-commit run --all-files
- pytest tests/main --verbosity=1
build:
stage: build
before_script:
- pip install --upgrade pip
- pip install .[dev]
script:
- python -m build
artifacts:
paths:
- dist/
expire_in: 1d
publish:
stage: publish
rules:
- if: $CI_COMMIT_TAG
when: manual
variables:
TWINE_USERNAME: __token__
TWINE_PASSWORD: $PYPI_TOKEN
before_script:
- pip install --upgrade pip
- pip install .[dev]
script:
- twine upload dist/* --verbose
build_python_docs:
extends:
- .build_docker_template
variables:
BUILD_CONTEXT: ${CI_PROJECT_DIR}
DOCKER_FILE: ${CI_PROJECT_DIR}/docs/Dockerfile
DOCKER_REPO: ${CI_REGISTRY_IMAGE}/python-docs
rules:
- !reference [.rules_template, web_manual]
.deploy_variables:
variables:
KUBERNETES_NAMESPACE_OVERWRITE: python-docs
K8S_DEPLOYMENT_DIR: rogii/python-docs
DEPLOY_COMPONENTS: "python-docs"
IMAGE_NAME: ${CI_REGISTRY_IMAGE}/python-docs
needs:
- build_python_docs
rules:
- !reference [.rules_template, web_manual]
deploy_awsstaging_k8s:
rules: [when: never]
deploy_kubesolo_k8s:
environment:
name: kubesolo
url: https://python.rogii.net
deploy_awsprod_k8s:
environment:
name: awsprod
url: https://python.solo.cloud