This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
forked from nextcloud/appstore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
100 lines (84 loc) · 3.25 KB
/
Makefile
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
poetry=poetry
poetry_run=$(poetry) run
python=$(poetry_run) python
pycodestyle=$(poetry_run) pycodestyle
pyresttest=$(poetry_run) pyresttest
coverage=$(poetry_run) coverage
bandit=$(poetry_run) bandit
mypy=$(poetry_run) mypy
manage-script=$(CURDIR)/manage.py
manage=$(poetry_run) $(manage-script)
db=sqlite
npm=npm
prod_version=12.0.0
.PHONY: lint
lint:
$(pycodestyle) $(CURDIR)/nextcloudappstore --exclude=migrations,development.py
$(mypy) --ignore-missing-imports $(CURDIR)/nextcloudappstore/api/v1/release
$(mypy) --ignore-missing-imports $(CURDIR)/nextcloudappstore/certificate
$(bandit) -r $(CURDIR)/nextcloudappstore -c $(CURDIR)/.bandit.yml
.PHONY: test
test: lint
$(npm) test
$(coverage) run --source=nextcloudappstore $(manage-script) test --settings nextcloudappstore.settings.development -v 2
$(coverage) report --fail-under 90
.PHONY: resetup
resetup:
rm -f db.sqlite3
$(MAKE) initdb
.PHONY: initmigrations
initmigrations:
rm -f $(CURDIR)/nextcloudappstore/**/migrations/0*.py
$(manage) makemigrations --settings nextcloudappstore.settings.development
# Only for local setup, do not use in production
.PHONY: dev-setup
dev-setup:
rm -f db.sqlite3
$(npm) install
$(npm) run build
$(poetry) install
cp $(CURDIR)/scripts/development/settings/base.py $(CURDIR)/nextcloudappstore/settings/development.py
cat $(CURDIR)/scripts/development/settings/$(db).py >> $(CURDIR)/nextcloudappstore/settings/development.py
$(MAKE) initdb
$(MAKE) l10n
.PHONY: initdb
initdb:
$(manage) migrate --settings nextcloudappstore.settings.development
$(manage) loaddata $(CURDIR)/nextcloudappstore/core/fixtures/*.json --settings nextcloudappstore.settings.development
$(manage) createsuperuser --username admin --email admin@admin.com --noinput --settings nextcloudappstore.settings.development
$(manage) verifyemail --username admin --email admin@admin.com --settings nextcloudappstore.settings.development
$(manage) setdefaultadminpassword --settings nextcloudappstore.settings.development
.PHONY: docs
docs:
$(MAKE) -C $(CURDIR)/docs/ clean html
.PHONY: update-dev-deps
update-dev-deps:
$(poetry) upgrade
$(npm) install --upgrade
.PHONY: authors
authors:
$(python) $(CURDIR)/scripts/generate_authors.py
.PHONY: clean
clean:
rm -rf $(CURDIR)/nextcloudappstore/core/static/vendor
rm -rf $(CURDIR)/nextcloudappstore/core/static/public
rm -rf $(CURDIR)/node_modules
$(MAKE) -C $(CURDIR)/docs/ clean
.PHONY: test-data
test-data: test-user
PYTHONPATH="${PYTHONPATH}:$(CURDIR)/scripts/" $(python) -m development.testdata
.PHONY: prod-data
prod-data:
PYTHONPATH="${PYTHONPATH}:$(CURDIR)/scripts/" $(python) -m development.proddata $(prod_version)
.PHONY: l10n
l10n:
$(manage) compilemessages --settings nextcloudappstore.settings.development
$(manage) importdbtranslations --settings nextcloudappstore.settings.development
.PHONY: coverage
coverage:
$(coverage) html
.PHONY: test-user
test-user:
$(manage) createtestuser --username user1 --password user1 --email user1@user.com --settings nextcloudappstore.settings.development
$(manage) createtestuser --username user2 --password user2 --email user2@user.com --settings nextcloudappstore.settings.development
$(manage) createtestuser --username user3 --password user3 --email user3@user.com --settings nextcloudappstore.settings.development