diff --git a/Makefile b/Makefile index 2150d54..629410e 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,13 @@ ENV=dev -VER=0.0.6 +VER=0.0.11 TAG=${ENV}-${VER} +TAG_ARM=${ENV}-arm-${VER} REGISTRY=kube-reg.fairfaxmedia.net +#REGISTRY=direct.fairfaxmedia.net:1529 + SVC=papi/svc1 DOCK_IMG=${REGISTRY}/${SVC}:${TAG} +DOCK_ARM=${REGISTRY}/${SVC}:${TAG_ARM} LIVE_HOST:="http://localhost:8912" clean: @@ -15,19 +19,40 @@ clean: install: pip3 install -r requirements.txt -coverage: clean install +report.xml: *.py 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-img: report.xml + docker build -t ${DOCK_IMG} --push . +arm-builder: + docker buildx create --name mybuilder --use --bootstrap --platform arm64 +docker-img-arm: report.xml + docker buildx build --builder mybuilder --platform linux/arm64 -t ${DOCK_ARM} --push . -f Dockerfile -docker-push: docker-img - docker push ${DOCK_IMG} +ideploy: docker-img + helm --kube-context microk8s install papi-${ENV} ./papi-helm/ -f ./papi-helm/v.${ENV}.yaml --set image.tag=${TAG} --set env.VERSION=${VER} --set name=papi-${ENV} -deploy: docker-push - helm upgrade papi ./papi-helm/ -f ./papi-helm/v.${ENV}.yaml --set image.tag=${TAG} --set env.VERSION=${VER} -integration: install +deploy: docker-img + helm --kube-context microk8s upgrade papi-${ENV} ./papi-helm/ -f ./papi-helm/v.${ENV}.yaml --set image.tag=${TAG} --set env.VERSION=${VER} --set name=papi-${ENV} + +ideploy-arm: docker-img-arm + helm --kube-context arm-k3s install papi-${ENV} ./papi-helm/ -f ./papi-helm/v.arm.${ENV}.yaml --set image.tag=${TAG_ARM} --set env.VERSION=${VER} --set name=papi-${ENV} +deploy-arm: docker-img-arm + helm --kube-context arm-k3s upgrade papi-${ENV} ./papi-helm/ -f ./papi-helm/v.arm.${ENV}.yaml --set image.tag=${TAG_ARM} --set env.VERSION=${VER} --set name=papi-${ENV} +integration: pyresttest ${LIVE_HOST} integration.pyrest.yaml + + + +arm-tok: + kubectl --context arm-k3s create token serviceaccounts-cluster-admin + echo login at https://k3a.fairfaxmedia.net + + +k8s-tok: + kubectl --context microk8s create token serviceaccounts-cluster-admin + echo login at https://kube.fairfaxmedia.net + run: install uvicorn papi:app --reload --port 8912 --host 0.0.0.0 diff --git a/papi-helm/v.arm.dev.yaml b/papi-helm/v.arm.dev.yaml new file mode 100644 index 0000000..a13fe2f --- /dev/null +++ b/papi-helm/v.arm.dev.yaml @@ -0,0 +1,7 @@ +ingress: + enabled: true + hosts: + - host: papi-arm-dev.fairfaxmedia.net + paths: + - path: / + pathType: ImplementationSpecific \ No newline at end of file diff --git a/papi-helm/v.arm.prod.yaml b/papi-helm/v.arm.prod.yaml new file mode 100644 index 0000000..8d4b2f3 --- /dev/null +++ b/papi-helm/v.arm.prod.yaml @@ -0,0 +1,7 @@ +ingress: + enabled: true + hosts: + - host: papi-arm.fairfaxmedia.net + paths: + - path: / + pathType: ImplementationSpecific \ No newline at end of file diff --git a/papi-helm/v.arm.qa.yaml b/papi-helm/v.arm.qa.yaml new file mode 100644 index 0000000..47e1545 --- /dev/null +++ b/papi-helm/v.arm.qa.yaml @@ -0,0 +1,7 @@ +ingress: + enabled: true + hosts: + - host: papi-arm-qa.fairfaxmedia.net + paths: + - path: / + pathType: ImplementationSpecific \ No newline at end of file