Newer
Older
web-services / Makefile
@Fran├žois Parmentier Fran├žois Parmentier on 3 Jan 1 KB feat: Add version-making helpers
.PHONY: help
.DEFAULT_GOAL := help

USER_ID = $(shell id -u)
GROUP_ID = $(shell id -g)

export UID = $(USER_ID)
export GID = $(GROUP_ID)

help:
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

shell: ## Open dockerized Bash terminal
	@docker-compose run --no-deps --rm shell

pycli: ## Open dockerized python command line interface
	@docker-compose run --no-deps --rm shell python3

python: ## Launch PYTHON daemon for one directory,  eg make python ./domains-classifier
	WORKING_DIR="$(filter-out $@,$(MAKECMDGOALS))" docker-compose up --no-deps --force-recreate python

nodejs: ## Launch NODEJS daemon for one directory,  eg make nodejs./base-line
	WORKING_DIR="$(filter-out $@,$(MAKECMDGOALS))" docker-compose up --no-deps --force-recreate nodejs

reset: ## Reset files permissions for all directory
	@docker-compose run --no-deps --rm shell bash -c "find /app -user daemon -exec chown ${UID}:${GID} {} \;"

version-major: ## Create a major version for a directory, e.g. make version-major mapping-tools
	@./bin/version-major.sh "$(filter-out $@,$(MAKECMDGOALS))"

version-minor: ## Create a minor version for a directory, e.g. make version-minor mapping-tools
	@./bin/version-minor.sh "$(filter-out $@,$(MAKECMDGOALS))"

version-patch: ## Create a patch version for a directory, e.g. make version-patch mapping-tools
	@./bin/version-patch.sh "$(filter-out $@,$(MAKECMDGOALS))"