1526
|
1 SERVICE=rfid_pn532_py
|
|
2 JOB=rfid
|
|
3 PORT=10012
|
|
4 RUNHOST=frontdoor
|
|
5
|
|
6 pyfreefare-build-x86/nfc.py: Dockerfile.pyfreefare.x86 pyfreefare/nfc.h pyfreefare/freefare.h build_ctypes_modules.sh
|
|
7 docker build --file Dockerfile.pyfreefare.x86 -t pyfreefare_build_x86:latest .
|
|
8 docker run --rm --net=host \
|
|
9 -v `pwd`/pyfreefare:/opt/pyfreefare \
|
|
10 -v `pwd`/pyfreefare-build-x86:/opt/pyfreefare-build \
|
|
11 --name pyfreefare_build pyfreefare_build_x86:latest
|
|
12
|
|
13 pyfreefare-build-pi/nfc.py: Dockerfile.pyfreefare.pi pyfreefare/nfc.h pyfreefare/freefare.h build_ctypes_modules.sh
|
|
14 docker build --file Dockerfile.pyfreefare.pi -t pyfreefare_build_pi:latest .
|
|
15 docker run --rm --net=host \
|
|
16 -v `pwd`/pyfreefare:/opt/pyfreefare \
|
|
17 -v `pwd`/pyfreefare-build-pi:/opt/pyfreefare-build \
|
|
18 --name pyfreefare_build pyfreefare_build_pi:latest
|
|
19
|
|
20 #pyfreefare/nfc.py pyfreefare/freefare.py
|
|
21 test_tags: tags.py tags_test.py
|
|
22 PYTHONPATH=pyfreefare-build-x86 nose2-3 tags_test
|
|
23
|
|
24
|
|
25 build_image_x86: pyfreefare-build-x86/nfc.py pyfreefare-build-x86/freefare.py Dockerfile.x86
|
|
26 rm -rf tmp_ctx
|
|
27 mkdir -p tmp_ctx
|
|
28 cp -a Dockerfile.x86 ../../lib/*.py *.py *.txt *.html pyfreefare-build-x86 tmp_ctx
|
|
29 docker build --network=host --file Dockerfile.x86 -t bang6:5000/$(SERVICE)_x86:latest tmp_ctx
|
|
30 docker push bang6:5000/$(SERVICE)_x86:latest
|
|
31
|
|
32 build_image_pi: pyfreefare-build-pi/nfc.py pyfreefare-build-pi/freefare.py Dockerfile.pi
|
|
33 rm -rf tmp_ctx
|
|
34 mkdir -p tmp_ctx
|
|
35 cp -a Dockerfile.pi ../../lib/*.py *.py *.txt *.html pyfreefare-build-pi tmp_ctx
|
|
36 docker build --network=host --file Dockerfile.pi -t bang6:5000/$(SERVICE)_pi:latest tmp_ctx
|
|
37 docker push bang6:5000/$(SERVICE)_pi:latest
|
|
38
|
|
39 run_local_x86: build_image_x86
|
|
40 docker run -it --rm --privileged --net=host --hostname=testhost --cap-add=SYS_PTRACE --name $(JOB)_run bang6:5000/$(SERVICE)_x86:latest python3 rfid.py -v
|
|
41
|
|
42
|
|
43 # test on pi:
|
|
44 # docker pull bang6:5000/rfid_pn532_py_pi:latest && docker run -it --rm --privileged --name rfid_shell bang6:5000/rfid_pn532_py_pi:latest nose2-3 tags_test
|
|
45
|
|
46 fresh_sudo:
|
|
47 sudo -v
|
|
48 redeploy: fresh_sudo build_image_pi
|
|
49 sudo /my/proj/ansible/playbook -l $(RUNHOST) -t rfid
|
|
50 supervisorctl -s http://$(RUNHOST):9001/ restart $(JOB)_$(PORT)
|
|
51
|
|
52 nginx_local:
|
|
53 nginx -c `pwd`/local.conf
|
|
54
|