forked from osl-incubator/growth-forge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.makim.yaml
164 lines (146 loc) · 4.72 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
version: 1.0
groups:
clean:
targets:
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:
targets:
build:
help: Build documentation
run: |
mkdocs build --config-file docs/mkdocs.yaml
preview:
help: Preview documentation page locally
dependencies:
- target: docs.build
run: |
mkdocs build --config-file docs/mkdocs.yaml
tests:
targets:
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: ""
params:
help: Specify parameters to be used for tests
type: string
default: "-v 3"
shell: bash
run: |
CMD="python manage.py test --no-input {{ args.app or args.module }} \
--settings={{ args.settings or env.DJANGO_SETTINGS_MODULE }} {{ args.params }}"
sugar ext start --services postgres --options -d
sugar run --service app --cmd $CMD
ci:
help: run the sames tests executed on CI
dependencies:
- target: tests.unit
- target: tests.linter
package:
targets:
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
targets:
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
targets:
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
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"
CMD="python manage.py makemigrations ${CMD_FLAG} sites growth_forge projects one_on_one growth_plan"
sugar run --service app --cmd $CMD
echo "[II] postgres is running."
migrate:
help: Migrate regarding to the current migration files
shell: bash
run: |
sugar ext start --services postgres --options -d
echo "[II] postgres is running."
CMD="python manage.py migrate --no-input"
sugar run --service app --cmd $CMD
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
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 }}
CMD="python manage.py createsuperuser --noinput --email {{ args.email }}"
sugar run --service app --cmd $CMD --options --env DJANGO_SUPERUSER_PASSWORD=$DJANGO_SUPERUSER_PASSWORD --env DJANGO_SUPERUSER_USERNAME=$DJANGO_SUPERUSER_USERNAME