From bdb1f30c019ceb63b1782c463c4240790864d0e5 Mon Sep 17 00:00:00 2001 From: Mike Graves Date: Fri, 2 Nov 2018 11:47:38 -0400 Subject: [PATCH] Add Makefile help This adds a default target that will print a help message for the Makefile. --- Makefile | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index ef80273..a631cc1 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,15 @@ -.PHONY: install deps wheel container dist clean test tests update +.PHONY: help install deps wheel container dist clean distclean test tests \ + update publish SHELL=/bin/bash S3_BUCKET=carbon-deploy -LIBAIO_SO=libaio.so.1.0.1 ORACLE_ZIP=instantclient-basiclite-linux.x64-18.3.0.0.0dbru.zip ECR_REGISTRY=672626379771.dkr.ecr.us-east-1.amazonaws.com -install: +help: ## Print this message + @awk 'BEGIN { FS = ":.*##"; print "Usage: make \n\nTargets:" } \ + /^[-_[:alpha:]]+:.?*##/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST) + +install: ## Install python dependencies (runs `pipenv install`) pipenv install vendor/$(ORACLE_ZIP): @@ -21,31 +25,31 @@ container: -t $(ECR_REGISTRY)/carbon:`git describe --always` \ -t carbon:latest . -dist: deps wheel container +dist: deps wheel container ## Build docker image @tput setaf 2 @tput bold @echo "Finished building docker image. Try running:" @echo " $$ docker run --rm carbon:latest" @tput sgr0 -clean: +clean: ## Remove build artifacts find . -name "*.pyc" -print0 | xargs -0 rm -f find . -name '__pycache__' -print0 | xargs -0 rm -rf rm -rf .coverage .tox *.egg-info .eggs build/ dist/ -distclean: clean +distclean: clean ## Remove build artifacts and vendor libs rm -rf vendor/ -test: +test: ## Run tests tox tests: test -update: +update: ## Update all python dependencies pipenv clean pipenv update --dev -publish: +publish: ## Push and tag the latest image (use `make dist && make publish`) $$(aws ecr get-login --no-include-email --region us-east-1) docker push $(ECR_REGISTRY)/carbon:latest docker push $(ECR_REGISTRY)/carbon:`git describe --always`