PY := python3 VENV := .venv all: help help: @ echo "USAGE:" @ echo "" @ echo " make deb-install -- Uses apt to install required system tools" @ echo " (for Debian-based systems only)" @ echo "" @ echo " make setup -- Create a local Python virtual environment" @ echo " that will hold requirements.pip modules" @ echo "" @ echo " make run -- Executes the logger" @ echo "" @ echo " make deploy -- Register meteorologger proccess on the" @ echo " supervisor daemon tool (requires root)" @ echo "" @ echo " make undeploy -- Unregister meteorologger proccess on the" @ echo " supervisor daemon tool (requires root)" @ echo "" @ echo " make tail-exec -- Follow the logger's execution.log" setup: venv apt-install: sudo apt-get install python3 python3-pip supervisor sudo pip3 install virtualenv venv: clean-venv @ echo "-------------------------------------------------------" virtualenv -v --python='${PY}' ${VENV} @ echo "Virtualenv with interpreter '${PY}' was created at ${VENV}" @ echo "-------------------------------------------------------" ${VENV}/bin/pip3 install --upgrade pip @ echo "-------------------------------------------------------" ${VENV}/bin/pip3 install -r requirements.pip @ echo "-------------------------------------------------------" @ echo "Virtualenv is ready at ${VENV}!" @ echo " " @ echo "TOTAL SIZE: " @ du -sh ${VENV} clean-venv: rm -rf ${VENV} run: sudo ${VENV}/bin/python3 logger.py deploy: sudo ${VENV}/bin/python3 deploy.py undeploy: sudo ${VENV}/bin/python3 deploy.py -u tail-exec: tail -F logs/execution.log