generated from Templates/Docker_Image
53 lines
1.9 KiB
Makefile
53 lines
1.9 KiB
Makefile
.ONESHELL:
|
|
ENV_PREFIX=$(shell python -c "if __import__('pathlib').Path('.venv/bin/pip').exists(): print('.venv/bin/')")
|
|
USING_POETRY=$(shell grep "tool.poetry" pyproject.toml && echo "yes")
|
|
|
|
.PHONY: issetup
|
|
issetup:
|
|
@[ -f .git/hooks/commit-msg ] || [ -z ${SKIP_MAKE_SETUP_CHECK+x} ] || (echo "You must run 'make setup' first to initialize the repo!" && exit 1)
|
|
|
|
.PHONY: setup
|
|
setup:
|
|
@cp .gitea/conventional_commits/commit-msg .git/hooks/
|
|
|
|
.PHONY: help
|
|
help: ## Show the help.
|
|
@echo "Usage: make <target>"
|
|
@echo ""
|
|
@echo "Targets:"
|
|
@fgrep "##" Makefile | fgrep -v fgrep
|
|
|
|
.PHONY: fmt
|
|
fmt: issetup ## Format code using black & isort.
|
|
$(ENV_PREFIX)isort n8n_ollama/
|
|
$(ENV_PREFIX)black -l 79 n8n_ollama/
|
|
$(ENV_PREFIX)black -l 79 tests/
|
|
|
|
.PHONY: lint
|
|
lint: issetup ## Run pep8, black, mypy linters.
|
|
$(ENV_PREFIX)flake8 n8n_ollama/
|
|
$(ENV_PREFIX)black -l 79 --check n8n_ollama/
|
|
$(ENV_PREFIX)black -l 79 --check tests/
|
|
$(ENV_PREFIX)mypy --ignore-missing-imports n8n_ollama/
|
|
|
|
.PHONY: release
|
|
release: issetup ## Create a new tag for release.
|
|
@echo "WARNING: This operation will create a version tag and push to gitea"
|
|
@read -p "Version? (provide the next x.y.z semver) : " TAG
|
|
@echo "$${TAG}" > n8n_ollama/VERSION
|
|
@$(ENV_PREFIX)gitchangelog > HISTORY.md
|
|
@git add n8n_ollama/VERSION HISTORY.md
|
|
@git commit -m "release: version $${TAG} 🚀"
|
|
@echo "creating git tag : $${TAG}"
|
|
@git tag $${TAG}
|
|
@git push -u origin HEAD --tags
|
|
@echo "Gitea Actions will detect the new tag and release the new version."
|
|
|
|
.PHONY: build
|
|
build: issetup ## Create a new tag for release.
|
|
@docker build -t n8n_ollama:$(cat n8n_ollama/VERSION) -f Containerfile .
|
|
|
|
# This project has been generated from rochacbruno/python-project-template
|
|
# __author__ = 'rochacbruno'
|
|
# __repo__ = https://github.com/rochacbruno/python-project-template
|
|
# __sponsor__ = https://github.com/sponsors/rochacbruno/
|