-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
111 lines (80 loc) · 3.48 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
101
102
103
104
105
106
107
108
109
110
111
build:
@docker compose build
clear-cache:
@CMD="poetry run python manage.py clear_cache" $(MAKE) exec-backend-command
collect-static:
@CMD="poetry run python manage.py collectstatic --noinput" $(MAKE) exec-backend-command
django-shell:
@CMD="poetry run python manage.py shell" $(MAKE) exec-backend-command-it
dump-data:
@CMD="poetry run python manage.py dumpdata github owasp --indent=2" $(MAKE) exec-backend-command > data/nest.json
enrich-data: github-enrich-issues owasp-enrich-chapters owasp-enrich-committees owasp-enrich-projects
exec-backend-command:
@docker exec -i nest-backend $(CMD)
exec-backend-command-it:
@docker exec -it nest-backend $(CMD) 2>/dev/null
github-enrich-issues:
@echo "Enriching GitHub issues"
@CMD="poetry run python manage.py github_enrich_issues" $(MAKE) exec-backend-command
github-update-owasp-organization:
@echo "Updating OWASP GitHub organization"
@CMD="poetry run python manage.py github_update_owasp_organization" $(MAKE) exec-backend-command
github-update-project-related-repositories:
@echo "Updating OWASP project related GitHub repositories"
@CMD="poetry run python manage.py github_update_project_related_repositories" $(MAKE) exec-backend-command
index-data:
@echo "Indexing Nest data"
@CMD="poetry run python manage.py algolia_reindex" $(MAKE) exec-backend-command
load-data:
@CMD="poetry run python manage.py load_data" $(MAKE) exec-backend-command
merge-migrations:
@CMD="poetry run python manage.py makemigrations --merge" $(MAKE) exec-backend-command
migrate:
@CMD="poetry run python manage.py migrate" $(MAKE) exec-backend-command
migrations:
@CMD="poetry run python manage.py makemigrations" $(MAKE) exec-backend-command
owasp-aggregate-projects:
@echo "Aggregating OWASP projects"
@CMD="poetry run python manage.py owasp_aggregate_projects" $(MAKE) exec-backend-command
owasp-enrich-chapters:
@echo "Enriching OWASP chapters"
@CMD="poetry run python manage.py owasp_enrich_chapters" $(MAKE) exec-backend-command
owasp-enrich-committees:
@echo "Enriching OWASP committees"
@CMD="poetry run python manage.py owasp_enrich_committees" $(MAKE) exec-backend-command
owasp-enrich-projects:
@echo "Enriching OWASP projects"
@CMD="poetry run python manage.py owasp_enrich_projects" $(MAKE) exec-backend-command
owasp-scrape-chapters:
@echo "Scraping OWASP site chapters data"
@CMD="poetry run python manage.py owasp_scrape_chapters" $(MAKE) exec-backend-command
owasp-scrape-committees:
@echo "Scraping OWASP site committees data"
@CMD="poetry run python manage.py owasp_scrape_committees" $(MAKE) exec-backend-command
owasp-scrape-projects:
@echo "Scraping OWASP site projects data"
@CMD="poetry run python manage.py owasp_scrape_projects" $(MAKE) exec-backend-command
poetry-update:
@CMD="poetry update" $(MAKE) exec-backend-command
pre-commit:
@pre-commit run -a
purge-data:
@CMD="poetry run python manage.py purge_data" $(MAKE) exec-backend-command
run:
@docker compose build
@docker compose up
setup:
@CMD="poetry run python manage.py createsuperuser" $(MAKE) exec-backend-command-it
shell:
@CMD="/bin/bash" $(MAKE) exec-backend-command-it
sync: update-data enrich-data index-data clear-cache
test:
@docker build -f backend/Dockerfile.test backend -t nest-backend-test
@docker run -e DJANGO_CONFIGURATION=Test nest-backend-test poetry run pytest
update-data: \
github-update-owasp-organization \
owasp-scrape-chapters \
owasp-scrape-committees \
owasp-scrape-projects \
github-update-project-related-repositories \
owasp-aggregate-projects