-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (60 loc) · 1.37 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
migrations:
@echo "Creating migrations"
@python manage.py makemigrations
migrate:
@echo "Migrating"
@python manage.py migrate
requirements:
@echo "Installing requirements"
rm -f requirements.txt
@pip freeze > requirements.txt
build:
@echo "Building"
@docker compose build --no-cache
up:
@echo "Starting"
@docker compose up
down:
@echo "Stopping"
@docker compose down
logs:
@echo "Showing logs"
@docker compose logs -f
restart: down up
demo: build up
clean: down
@echo "Cleaning"
@docker image prune -f
release:
@echo "Creating release"
@if [ -z "$(v)" ]; then \
read -p "Enter version (v): " v; \
fi; \
echo "Version: $$v"; \
echo "Checkout main"; \
git checkout main; \
echo "Pulling main"; \
git pull origin main; \
echo "Create version.txt"; \
echo $$v > version.txt; \
echo "Committing version.txt"; \
git add version.txt; \
git commit -m "Bump version to $$v"; \
echo "Pushing version.txt"; \
git push origin main; \
echo "Creating tag $$v"; \
git tag $$v; \
echo "Pushing tag $$v"; \
git push origin $$v
version:
@echo "Updating version.txt with latest tag"
@TAG=$(shell git describe --tags --abbrev=0) && \
echo "Latest tag: $$TAG" && \
echo $$TAG > version.txt && \
echo "version.txt updated with tag $$TAG"
admin:
@echo "Creating superuser"
@python manage.py createsuperuser
shell:
@echo "Starting shell"
@python manage.py shell