forked from adfinis/outdated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
95 lines (71 loc) · 2.73 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
.DEFAULT_GOAL := help
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort -k 1,1 | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: api-sh
api-sh: ## Shell into the API
@docker compose run --rm api sh
.PHONY: api-lint
api-lint: ## Lint the backend
@docker compose run --rm api sh -c "ruff format --check . ; ruff check . --output-format=full"
.PHONY: api-lint-fix
api-lint-fix: ## Lint and fix the API
@docker compose run --rm api sh -c "ruff format . && ruff check . --fix"
.PHONY: api-shell
api-shell: ## Open django shell
@docker compose exec api ./manage.py shell
.PHONY: api-start
api-start: ## Start the API
@docker compose up db api -d --build
.PHONY: api-test
api-test: ## Test the API
@docker compose run --rm api sh -c 'ENV=test pytest --no-cov-on-fail --cov -vvv -s'
.PHONY: build
build: ## Build the containers
@docker compose build
.PHONY: cleanup
cleanup: ## Cleanup all docker containers, images, volumes and networks from the project
@docker compose down -v --timeout 0
.PHONY: ember-lint
ember-lint: ## lint ember
@cd ember && pnpm lint
.PHONY: ember-lint-fix
ember-lint-fix: ## lint and fix ember
@cd ember && pnpm lint:fix
.PHONY: ember-start
ember-start: ## Start ember
@docker compose up ember --build -d
.PHONY: ember-start-livereload
ember-start-livereload: ## Start ember with livereload
@docker compose up -d --build db keycloak api caddy && cd ember && pnpm i && pnpm start-proxy
.PHONY: ember-test
ember-test: ## test the frontend
@cd ember && pnpm test:ember
.PHONY: lint
lint: api-lint ember-lint ## Lint the API and ember
.PHONY: lint-fix
lint-fix: api-lint-fix ember-lint-fix ## Lint and fix the API and ember
.PHONY: flush
flush: ## Flush the db
@docker compose run --rm api ./manage.py flush --no-input
.PHONY: makemigrations
makemigrations: ## Make django migrations
@docker compose run --rm api python ./manage.py makemigrations
.PHONY: migrate
migrate: ## Migrate django
@docker compose run --rm api python ./manage.py migrate
.PHONY: migrate-zero
migrate-zero: ## Unapply all django migrations
@docker compose run --rm api python ./manage.py migrate outdated zero
@docker compose run --rm api python ./manage.py migrate user zero
.PHONY: keycloak-import
keycloak-import: ## Import keycloak configuration
@docker compose exec keycloak /opt/keycloak/bin/kc.sh import --override true --file /opt/keycloak/data/import/config.json
.PHONY: keycloak-export
keycloak-export: ## Export keycloak configuration
@docker compose exec keycloak /opt/keycloak/bin/kc.sh export --file /opt/keycloak/data/import/config.json
.PHONY: start
start: ## Start the application
@docker compose up -d --build
.PHONY: test
test: api-test ember-test ## Test the API and ember