-
Notifications
You must be signed in to change notification settings - Fork 136
/
Makefile
84 lines (69 loc) · 2.72 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
manage-script=$(CURDIR)/manage.py
manage=poetry run $(manage-script)
db=sqlite
.PHONY: test
test:
npm test
poetry run coverage run --source=nextcloudappstore $(manage-script) test --settings nextcloudappstore.settings.development -v 2
poetry run 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
.PHONY: html
docs html:
$(MAKE) -C $(CURDIR)/docs/ clean html
.PHONY: update-dev-deps
update-dev-deps:
poetry upgrade
npm install --upgrade
.PHONY: authors
authors:
poetry run 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/" poetry run python -m development.testdata
.PHONY: prod-data
prod-data:
PYTHONPATH="${PYTHONPATH}:$(CURDIR)/scripts/" poetry run python -m development.proddata 27.0.0
.PHONY: l10n
l10n:
$(manage) compilemessages --settings nextcloudappstore.settings.development
$(manage) importdbtranslations --settings nextcloudappstore.settings.development
.PHONY: coverage
coverage:
poetry run coverage xml
.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