-
Notifications
You must be signed in to change notification settings - Fork 4
/
.makim.yaml
192 lines (173 loc) · 5.25 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
version: 1.0
groups:
clean:
tasks:
tmp:
help: Clean unnecessary temporary files
shell: bash
run: |
rm -fr build/
rm -fr dist/
rm -fr .eggs/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
rm -fr .mypy_cache
rm -fr .ruff_cache
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
find . -name '*~' -exec rm -f {} +
docs:
tasks:
build:
help: Build documentation
run: |
mkdocs build --config-file mkdocs.yaml
preview:
help: Preview documentation page locally
dependencies:
- task: docs.build
run: |
mkdocs build --config-file docs/mkdocs.yaml
tests:
tasks:
linter:
help: Run linter tools
run: |
pre-commit install
pre-commit run --all-files --verbose
unit:
help: Run tests
args:
app:
help: The name of the app
type: string
module:
help: Specify the python module used for the test
type: string
default: ""
settings:
help: Specify the django settings module
type: string
default: "config.settings.test"
params:
help: Specify parameters to be used for tests
type: string
default: "-vvv"
shell: bash
env:
POSTGRES_HOST: localhost
POSTGRES_USER: postgres-admin
POSTGRES_PASSWORD: 1kdis94id
POSTGRES_PORT: 45432
POSTGRES_DBNAME: postgres
ENV: dev
run: |
sugar ext start --services postgres --options -d
pytest ${{ args.app or args.module }} \
--ds=${{ args.settings or env.DJANGO_SETTINGS_MODULE }} ${{ args.params }}
ci:
help: run the sames tests executed on CI
dependencies:
- task: tests.unit
- task: tests.linter
package:
tasks:
build:
help: "Build the package"
run: poetry build
release:
vars:
app: |
npx --yes \
-p semantic-release \
-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 "@google/semantic-release-replace-plugin" \
semantic-release
tasks:
ci:
help: run semantic release on CI
run: ${{ vars.app }} --ci
dry:
help: run semantic release in dry-run mode
run: ${{ vars.app }} --dry-run
django:
help: command for the django app
tasks:
makemigrations:
help: Run django makemigrations command (just for development)
shell: bash
args:
check:
help: |
Just check if the latest migration files were already created.
type: bool
action: store_true
env:
POSTGRES_HOST: localhost
POSTGRES_USER: postgres-admin
POSTGRES_PASSWORD: 1kdis94id
POSTGRES_PORT: 45432
POSTGRES_DBNAME: postgres
run: |
sugar ext start --services postgres --options -d
CWD=$(pwd)
CMD_FLAG="${{ '--check' if args.check else '' }} --no-input"
echo -e "\nMaking migration files ...\n"
pushd src
python manage.py makemigrations ${CMD_FLAG} sites growth_forge projects one_on_one growth_plan
popd
echo "[II] postgres is running."
migrate:
help: Migrate regarding to the current migration files
shell: bash
env:
POSTGRES_HOST: localhost
POSTGRES_USER: postgres-admin
POSTGRES_PASSWORD: 1kdis94id
POSTGRES_PORT: 45432
POSTGRES_DBNAME: postgres
run: |
sugar ext start --services postgres --options -d
echo "[II] postgres is running."
pushd src
python manage.py migrate --no-input
popd
create-superuser:
args:
email:
help: Specify the username
type: string
required: True
username:
help: Specify the username
type: string
required: True
password:
help: Specify the password
type: string
required: True
help: create an admin user
shell: bash
env:
POSTGRES_HOST: localhost
POSTGRES_USER: postgres-admin
POSTGRES_PASSWORD: 1kdis94id
POSTGRES_PORT: 45432
POSTGRES_DBNAME: postgres
run: |
sugar ext start --services postgres --options -d
echo "[II] postgres is running."
export DJANGO_SUPERUSER_PASSWORD=${{ args.password }}
export DJANGO_SUPERUSER_USERNAME=${{ args.username }}
pushd src
python manage.py createsuperuser --noinput --email ${{ args.email }}
popd