Files
papi-py/Makefile
stephen schuresko b9bf105939
All checks were successful
Build and Push to Private Registry101 / build (push) Successful in 33s
feat: update Dockerfile and Makefile for improved deployment; add integration testing instructions and version endpoint
2025-02-18 08:29:31 -05:00

35 lines
887 B
Makefile

ENV=dev
VER=0.0.4
TAG=${ENV}-${VER}
REGISTRY=kube-reg.fairfaxmedia.net
SVC=papi/svc1
DOCK_IMG=${REGISTRY}/${SVC}:${TAG}
LIVE_HOST:="http://localhost:8912"
clean:
rm -rf .pytest_cache
rm -rf .coverage
rm -rf report.xml
rm -rf test.db
rm -rf htmlcov
install:
pip3 install -r requirements.txt
coverage: clean install
pytest --cov=papi --cov=posts --cov=users test_papi.py test_posts.py test_users.py --junitxml=report.xml --cov-report=html --cov-report=xml --cov-report=term --cov-fail-under 90
docker-img: coverage
docker build -t ${DOCK_IMG} .
docker-push: docker-img
docker push ${DOCK_IMG}
deploy: docker-push
helm upgrade papi ./papi-helm/ -f ./papi-helm/v.${ENV}.yaml --set image.tag=${TAG} --set env.VERSION=${VER}
integration: install
pyresttest ${LIVE_HOST} integration.pyrest.yaml
run: install
uvicorn papi:app --reload --port 8912 --host 0.0.0.0
all: deploy