Update Makefile to make testing runs easier

This commit is contained in:
IamTheFij 2019-08-01 14:50:09 -07:00
parent 9a8dbdbfef
commit e3e54c7a0f

View File

@ -5,6 +5,10 @@ ENV := env
.PHONY: default .PHONY: default
default: test default: test
# Create sample config
config.yml:
cp sample-config.yml config.yml
# Creates virtualenv # Creates virtualenv
$(ENV): $(ENV):
python3 -m venv $(ENV) python3 -m venv $(ENV)
@ -39,12 +43,12 @@ build-env: $(ENV)/bin/twine $(ENV)/bin/wheel
# Runs Minitor # Runs Minitor
.PHONY: run .PHONY: run
run: $(ENV)/bin/minitor run: $(ENV)/bin/minitor config.yml
$(ENV)/bin/minitor -vvv $(ENV)/bin/minitor -vvv
# Runs Minitor with metrics # Runs Minitor with metrics
.PHONY: run-metrics .PHONY: run-metrics
run-metrics: $(ENV) run-metrics: $(ENV) config.yml
$(ENV)/bin/python -m minitor.main --metrics $(ENV)/bin/python -m minitor.main --metrics
# Runs tests with tox # Runs tests with tox
@ -132,14 +136,14 @@ docker-cross-build-arm64: build/qemu-aarch64-static
# Run on host architechture # Run on host architechture
.PHONY: docker-run .PHONY: docker-run
docker-run: docker-build docker-run: docker-build config.yml
docker run ${DOCKER_TAG}-linux-amd64 docker run --rm -v $(shell pwd)/config.yml:/app/config.yml ${DOCKER_TAG}-linux-amd64
# Cross run on host architechture # Cross run on host architechture
.PHONY: docker-cross-run-arm .PHONY: docker-cross-run-arm
docker-cross-run-arm: docker-cross-build-arm docker-cross-run-arm: docker-cross-build-arm config.yml
docker run --rm ${DOCKER_TAG}-linux-arm docker run --rm -v $(shell pwd)/config.yml:/app/config.yml ${DOCKER_TAG}-linux-arm
.PHONY: docker-cross-run-arm64 .PHONY: docker-cross-run-arm64
docker-cross-run-arm64: docker-cross-build-arm64 docker-cross-run-arm64: docker-cross-build-arm64 config.yml
docker run --rm ${DOCKER_TAG}-linux-arm64 docker run --rm -v $(shell pwd)/config.yml:/app/config.yml ${DOCKER_TAG}-linux-arm64