-
Notifications
You must be signed in to change notification settings - Fork 4
/
bitbucket-pipelines.yml
142 lines (136 loc) · 4.16 KB
/
bitbucket-pipelines.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
image: python:3.11
definitions:
caches:
docker-cliplugins: ~/.docker/cli-plugins
yaml-anchors:
- &setup-docker-compose-latest-script >-
wget --no-verbose --no-clobber https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 --output-document ~/.docker/cli-plugins/docker-compose
|| true
; chmod a+x ~/.docker/cli-plugins/docker-compose
&& ln --symbolic ~/.docker/cli-plugins/docker-compose /usr/local/bin/docker-compose
.set_environment: &set_environment |
export PYTHONUNBUFFERED=1
export PYTHONDONTWRITEBYTECODE=1
export PIP_NO_CACHE_DIR=off
export PIP_DISABLE_PIP_VERSION_CHECK=on
export PIP_DEFAULT_TIMEOUT=100
export POETRY_HOME="/opt/poetry"
export POETRY_VIRTUALENVS_IN_PROJECT=true
export POETRY_NO_INTERACTION=1
export PYSETUP_PATH="/opt/pysetup"
export VENV_PATH="/opt/pysetup/.venv"
export PIPX_HOME="/usr/local/pipx"
export PIPX_BIN_DIR="/usr/local/bin"
export PATH="${POETRY_HOME}/bin:${VENV_PATH}/bin:${PATH}"
echo "${PATH}"
.set_buildkit_false: &set_buildkit_false |
export DOCKER_BUILDKIT=0
.install_poetry: &install_poetry |
pip install pipx~=1.7.1
pipx install poetry~=1.8.3
options:
docker: true
pipelines:
default:
- parallel: &tests
- step:
name: Unit tests
caches:
- pip
- docker-cliplugins
script:
- *set_environment
- *set_buildkit_false
- *setup-docker-compose-latest-script
- *install_poetry
- make install-deps
- make unit
- step:
name: Linting
caches: [pip]
script:
- *set_environment
- *install_poetry
- make install-deps
- poetry run pylint src/sovereign
- step:
name: Format check
caches: [pip]
script:
- *set_environment
- *install_poetry
- make install-deps
- poetry run black --check src/sovereign
- step:
name: Type checks
caches: [pip]
script:
- *set_environment
- *install_poetry
- make install-deps
- poetry run mypy src/sovereign
- parallel: &acceptance
- step:
name: envoy-1.18.2
caches:
- pip
- docker-cliplugins
script:
- *set_buildkit_false
- *setup-docker-compose-latest-script
- ENVOY_VERSION=v1.18.2 make test-envoy-version
- step:
name: envoy-1.24.1
caches:
- pip
- docker-cliplugins
script:
- *set_buildkit_false
- *setup-docker-compose-latest-script
- ENVOY_VERSION=v1.24.1 make test-envoy-version
- step:
name: envoy-1.25.3
caches:
- pip
- docker-cliplugins
script:
- *set_buildkit_false
- *setup-docker-compose-latest-script
- ENVOY_VERSION=v1.25.3 make test-envoy-version
branches:
master:
- parallel: *tests
- parallel: *acceptance
- step:
name: Mirror to github
script:
- git remote add github [email protected]:cetanu/sovereign.git
- git fetch --unshallow github
- git branch --set-upstream-to master
- git push --set-upstream --force github master
tags:
'*.*.*':
- step:
name: Release to PyPI
deployment: release
caches: [pip]
script:
- *set_environment
- *set_buildkit_false
- *install_poetry
- make install-deps
- make release
'*.*.*rc*': &prerelease
- step:
name: Pre-release to PyPI
deployment: prerelease
caches: [pip]
script:
- *set_environment
- *set_buildkit_false
- *install_poetry
- make install-deps
- poetry run python scripts/release_check.py
- make release
'*.*.*a*': *prerelease
'*.*.*b*': *prerelease