-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
.makim.yaml
253 lines (236 loc) · 9.26 KB
/
.makim.yaml
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
backend: bash
groups:
clean:
env-file: .env
tasks:
tmp:
help: Remove build artifacts, compiled files, and cache
run: |
rm -f .coverage
rm -fr build/
rm -fr dist/
rm -fr .eggs/
rm -fr htmlcov/
rm -fr .pytest_cache
rm -fr .ruff_cache
rm -fr .mypy_cache
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
find . -name '*~' -exec rm -f {} +
docs:
help: Commands for building and previewing the documentation
tasks:
build:
help: Build the documentation
run: mkdocs build --config-file mkdocs.yaml
preview:
help: Preview the documentation
hooks:
pre-run:
- task: docs.build
run: mkdocs serve --watch docs --config-file mkdocs.yaml
package:
help: helper commands for handling the package
tasks:
build:
help: Build the project
run: poetry build
tests:
help: Test commands
tasks:
linter:
help: Run lint checks
run: |
pre-commit install
pre-commit run --all-files --verbose
unit:
help: Run tests
args:
params:
help: Extra parameters for pytest
type: string
default: "-vv"
run: pytest -s ${{ args.params }} tests
smoke-1:
help: Run smoke tests for group 1
hooks:
pre-run:
- task: docker.killall
vars:
SUGAR_FLAGS: --verbose --group group1
run: |
sugar ${{ vars.SUGAR_FLAGS }} compose build
sugar ${{ vars.SUGAR_FLAGS }} compose build --all
sugar ${{ vars.SUGAR_FLAGS }} compose build
sugar ${{ vars.SUGAR_FLAGS }} compose build --services service1-1
sugar ${{ vars.SUGAR_FLAGS }} compose pull --all
sugar ${{ vars.SUGAR_FLAGS }} compose pull
sugar ${{ vars.SUGAR_FLAGS }} compose pull --services service1-1
sugar ${{ vars.SUGAR_FLAGS }} compose-ext start --all --options -d
sugar ${{ vars.SUGAR_FLAGS }} compose-ext restart --all --options -d
sugar ${{ vars.SUGAR_FLAGS }} compose exec --service service1-1 --options -T --cmd env
sugar ${{ vars.SUGAR_FLAGS }} compose stop --all
sugar ${{ vars.SUGAR_FLAGS }} compose run --service service1-1 --options -T --cmd env
sugar ${{ vars.SUGAR_FLAGS }} compose down
smoke-2:
help: Run smoke tests for group 2
hooks:
pre-run:
- task: docker.killall
vars:
SUGAR_FLAGS: --verbose --group group2
run: |
sugar ${{ vars.SUGAR_FLAGS }} compose build --all
sugar ${{ vars.SUGAR_FLAGS }} compose build
sugar ${{ vars.SUGAR_FLAGS }} compose build --services service2-1
sugar ${{ vars.SUGAR_FLAGS }} compose pull --all
sugar ${{ vars.SUGAR_FLAGS }} compose stop --all
sugar ${{ vars.SUGAR_FLAGS }} compose run --service service2-1 --options -T --cmd env
sugar ${{ vars.SUGAR_FLAGS }} compose down
smoke-services:
help: Run smoke test for services
hooks:
pre-run:
- task: docker.killall
run: |
sugar --verbose --file tests/containers/.services.sugar.yaml compose build
smoke-mix:
help: Run smoke tests for group mix
hooks:
pre-run:
- task: docker.killall
vars:
SUGAR_FLAGS: --verbose --group group-mix
run: |
sugar ${{ vars.SUGAR_FLAGS }} compose build --all
sugar ${{ vars.SUGAR_FLAGS }} compose build
sugar ${{ vars.SUGAR_FLAGS }} compose build --services service1-1,service2-1
sugar ${{ vars.SUGAR_FLAGS }} compose pull --all
sugar ${{ vars.SUGAR_FLAGS }} compose pull
sugar ${{ vars.SUGAR_FLAGS }} compose pull --services service1-1,service2-1
sugar ${{ vars.SUGAR_FLAGS }} compose-ext start --all --options -d
sugar ${{ vars.SUGAR_FLAGS }} compose-ext restart --all --options -d
sugar ${{ vars.SUGAR_FLAGS }} compose exec --service service2-1 --options -T --cmd env
sugar ${{ vars.SUGAR_FLAGS }} compose stop --all
sugar ${{ vars.SUGAR_FLAGS }} compose run --service service2-1 --options -T --cmd env
sugar ${{ vars.SUGAR_FLAGS }} compose down
smoke-main:
help: Run smoke tests for group main
hooks:
pre-run:
- task: docker.killall
vars:
SUGAR_FLAGS: --verbose --group group1
run: |
# general tests main profile/plugins
sugar ${{ vars.SUGAR_FLAGS }} compose build
sugar ${{ vars.SUGAR_FLAGS }} compose config
sugar ${{ vars.SUGAR_FLAGS }} compose create
sugar ${{ vars.SUGAR_FLAGS }} compose-ext start --options -d
sugar ${{ vars.SUGAR_FLAGS }} compose-ext restart --options -d
sugar ${{ vars.SUGAR_FLAGS }} compose exec --service service1-1 --options -T --cmd env
sugar ${{ vars.SUGAR_FLAGS }} compose images
sugar ${{ vars.SUGAR_FLAGS }} compose logs
# port is not complete supported
# sugar --verbose compose port --service service1-1
sugar ${{ vars.SUGAR_FLAGS }} compose ps
sugar ${{ vars.SUGAR_FLAGS }} compose pull
sugar ${{ vars.SUGAR_FLAGS }} compose push
sugar ${{ vars.SUGAR_FLAGS }} compose run --service service1-1 --options -T --cmd env
sugar ${{ vars.SUGAR_FLAGS }} compose top
sugar ${{ vars.SUGAR_FLAGS }} compose up --options -d
sugar ${{ vars.SUGAR_FLAGS }} compose version
# port is not complete supported
export SUGAR_PROJECT_NAME="test-`python -c 'from uuid import uuid4; print(uuid4().hex[:7])'`"
echo $SUGAR_PROJECT_NAME
sugar ${{ vars.SUGAR_FLAGS }} compose build
sugar ${{ vars.SUGAR_FLAGS }} compose-ext start --options -d
sugar ${{ vars.SUGAR_FLAGS }} compose-ext restart --options -d
# TODO: it seems that the SUGAR_PROJECT_NAME is not used properly from this block
# docker ps|grep $SUGAR_PROJECT_NAME
sugar ${{ vars.SUGAR_FLAGS }} compose-ext stop
smoke-final:
help: Run final smoke tests
hooks:
pre-run:
- task: docker.killall
run: |
sugar --verbose --group group-defaults compose-ext restart --options -d
sugar --verbose --group group1 compose pause
sugar --verbose --group group1 compose unpause
sugar --verbose --group group1 compose kill
sugar --verbose --group group1 compose stop
sugar --verbose --group group1 compose rm --options --force
sugar --verbose --group group1 compose down
smoke-experimental:
help: Run simple text for experimental commands
hooks:
pre-run:
- task: docker.killall
run: |
sugar --verbose compose attach --help
sugar --verbose compose cp --help
sugar --verbose compose ls --help
sugar --verbose compose scale --help
sugar --verbose compose wait --help
sugar --verbose compose watch --help
smoke-hooks:
help: Run simple text for experimental commands
hooks:
pre-run:
- task: docker.killall
vars:
SUGAR_FLAGS: --file .hooks.sugar.yaml
dir: tests/containers
run: |
sugar ${{ vars.SUGAR_FLAGS }} compose config | grep "RUNNING PRE-RUN FOR CONFIG"
sugar ${{ vars.SUGAR_FLAGS }} compose config | grep "CONFIG EXECUTED WITH SUCCESS"
sugar ${{ vars.SUGAR_FLAGS }} compose-ext config | grep "RUNNING PRE-RUN FOR CONFIG"
sugar ${{ vars.SUGAR_FLAGS }} compose-ext config | grep "CONFIG EXECUTED WITH SUCCESS"
smoke:
help: Run final smoke tests
hooks:
pre-run:
- task: docker.killall
- task: tests.smoke-1
- task: tests.smoke-2
- task: tests.smoke-mix
- task: tests.smoke-main
- task: tests.smoke-final
- task: tests.smoke-services
- task: tests.smoke-experimental
- task: tests.smoke-hooks
run: |
sugar --verbose compose --help
sugar --verbose compose version
docker:
help: Commands for docker
tasks:
killall:
help: Kill all running Docker containers
run: docker kill `docker ps -q` || true
release:
vars:
app: |
npx --yes \
-p semantic-release \
-p [email protected] \
-p "@semantic-release/commit-analyzer" \
-p "@semantic-release/release-notes-generator" \
-p "@semantic-release/changelog" \
-p "@semantic-release/exec" \
-p "@semantic-release/github" \
-p "@semantic-release/git" \
-p "semantic-release-replace-plugin" \
semantic-release
tasks:
ci:
help: Run semantic-release on CI
run: |
${{ vars.app }} --ci
dry:
help: Run semantic-release on CI
run: |
${{ vars.app }} --dry-run