-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (57 loc) · 1.85 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
IMAGE=shipanaro
VERSION?=latest
init-data:
./indocker.sh ./manage.py migrate humans
./indocker.sh ./manage.py migrate
test-user-delete:
docker-compose run --entrypoint 'ldapdelete -x -H ldap://ldap -D "cn=admin,dc=pirata,dc=cat" -w admin "cn=tester,dc=pirata,dc=cat"' ldap || echo "User doesn't exist"
test-user-create: test-user-delete
docker-compose run web ./create_ldap_user.py tester tester --create-ou
test-users-delete:
make ldap-list | grep tester | grep sn | cut -d ' ' -f2 | xargs -n1 ./delete_ldap_user.py
shell:
./indocker.sh ./manage.py shell
clean-data:
docker-compose down --volumes
lint:
black .
run: stop
docker-compose up --build
infra:
docker-compose up db ldap ldapadmin
stop:
docker-compose down
test: # test-user-create
docker-compose run web ./manage.py test -v2
collected: static
./indocker.sh ./manage.py collectstatic --noinput
ldap-list:
docker-compose exec ldap ldapsearch -x -H ldap://localhost -b dc=pirata,dc=cat -D "cn=admin,dc=pirata,dc=cat" -w admin
i18n:
./manage.py makemessages --locale ca
@echo "Please edit locale/ca/LC_MESSAGES/django.po to add new translations"
i18n-compile:
./manage.py compilemessages --ignore .venv
package:
docker build -t ${IMAGE}:${VERSION} .
publish:
docker tag ${IMAGE}:${VERSION} piratescat/${IMAGE}:${VERSION}
docker push piratescat/${IMAGE}:${VERSION}
k8s-restart:
kubectl rollout restart deploy/${IMAGE}
serve:
exec gunicorn \
--bind 0.0.0.0:8000 \
--workers 2 shipanaro.mediawsgi \
--capture-output --log-file="-" \
--access-logfile="-" | tee -a tripulacio.log
reload-gunicorn:
kill -HUP `pgrep gunicorn | head -n 1`
update:
git pull || echo "Cannot pull"
pipenv install
pipenv run ./manage.py compilemessages
pipenv run ./manage.py migrate
pipenv run ./manage.py collectstatic --noinput
make reload-gunicorn
.PHONY: init-data clean-data lint run stop test ldap-test