mirror of
https://github.com/craigerl/aprsd.git
synced 2024-12-20 08:31:11 -05:00
Added self creating Makefile help target
This updates the Makefile to include a default target of help and it automatically generates the help based on the targets and their descriptions.
This commit is contained in:
parent
dfaf3aa3d1
commit
d643ca3892
51
Makefile
51
Makefile
@ -1,5 +1,7 @@
|
|||||||
REQUIREMENTS_TXT ?= requirements.txt dev-requirements.txt
|
REQUIREMENTS_TXT ?= requirements.txt dev-requirements.txt
|
||||||
|
.DEFAULT_GOAL := help
|
||||||
|
|
||||||
|
.PHONY: dev docs server test
|
||||||
include Makefile.venv
|
include Makefile.venv
|
||||||
Makefile.venv:
|
Makefile.venv:
|
||||||
curl \
|
curl \
|
||||||
@ -9,50 +11,45 @@ Makefile.venv:
|
|||||||
| sha256sum --check - \
|
| sha256sum --check - \
|
||||||
&& mv Makefile.fetched Makefile.venv
|
&& mv Makefile.fetched Makefile.venv
|
||||||
|
|
||||||
all: pip dev
|
help: # Help for the Makefile
|
||||||
|
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
.PHONY: dev
|
dev: venv ## Create the virtualenv with all the requirements installed
|
||||||
dev: venv
|
|
||||||
$(VENV)/pre-commit install
|
|
||||||
|
|
||||||
.PHONY: docs
|
|
||||||
docs: build
|
docs: build
|
||||||
cp README.rst docs/readme.rst
|
cp README.rst docs/readme.rst
|
||||||
cp Changelog docs/changelog.rst
|
cp Changelog docs/changelog.rst
|
||||||
tox -edocs
|
tox -edocs
|
||||||
|
|
||||||
.PHONY: server
|
clean: clean-venv ## Clean out any build artifacts to start over
|
||||||
server: venv
|
|
||||||
$(VENV)/aprsd server --loglevel DEBUG
|
|
||||||
|
|
||||||
clean: clean-venv
|
|
||||||
rm -rf dist/*
|
rm -rf dist/*
|
||||||
|
|
||||||
.PHONY: test
|
test: dev ## Run all the tox tests
|
||||||
test: dev
|
|
||||||
tox -p all
|
tox -p all
|
||||||
|
|
||||||
build: test
|
build: test ## Make the build artifact prior to doing an upload
|
||||||
$(VENV)/python3 setup.py sdist bdist_wheel
|
$(VENV)/python3 setup.py sdist bdist_wheel
|
||||||
$(VENV)/twine check dist/*
|
$(VENV)/twine check dist/*
|
||||||
|
|
||||||
upload: build
|
upload: build ## Upload a new version of the plugin
|
||||||
$(VENV)/twine upload dist/*
|
$(VENV)/twine upload dist/*
|
||||||
|
|
||||||
docker: test
|
check: dev ## Code format check with tox and pep8
|
||||||
docker build -t hemna6969/aprsd:latest -f docker/Dockerfile docker
|
|
||||||
|
|
||||||
docker-dev: test
|
|
||||||
docker build -t hemna6969/aprsd:master -f docker/Dockerfile-dev docker
|
|
||||||
|
|
||||||
update-requirements: dev
|
|
||||||
$(VENV)/pip-compile requirements.in
|
|
||||||
$(VENV)/pip-compile dev-requirements.in
|
|
||||||
|
|
||||||
|
|
||||||
check: dev # Code format check with isort and black
|
|
||||||
tox -efmt-check
|
tox -efmt-check
|
||||||
tox -epep8
|
tox -epep8
|
||||||
|
|
||||||
fix: dev # fixes code formatting with isort and black
|
fix: dev ## fixes code formatting with gray
|
||||||
tox -efmt
|
tox -efmt
|
||||||
|
|
||||||
|
server: venv ## Create the virtual environment and run aprsd server --loglevel DEBUG
|
||||||
|
$(VENV)/aprsd server --loglevel DEBUG
|
||||||
|
|
||||||
|
docker: test ## Make a docker container tagged with hemna6969/aprsd:latest
|
||||||
|
docker build -t hemna6969/aprsd:latest -f docker/Dockerfile docker
|
||||||
|
|
||||||
|
docker-dev: test ## Make a development docker container tagged with hemna6969/aprsd:master
|
||||||
|
docker build -t hemna6969/aprsd:master -f docker/Dockerfile-dev docker
|
||||||
|
|
||||||
|
update-requirements: dev ## Update the requirements.txt and dev-requirements.txt files
|
||||||
|
$(VENV)/pip-compile requirements.in
|
||||||
|
$(VENV)/pip-compile dev-requirements.in
|
||||||
|
Loading…
Reference in New Issue
Block a user