-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
50 lines (39 loc) · 1.27 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
DOCKER_BUILD_CMD = docker build
detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
ifeq ($(detected_OS),Darwin) # Mac OS X
DOCKER_BUILD_CMD = docker buildx build --platform linux/amd64
endif
dev-requires:
pip install -e .[dev]
flake8:
@echo "Check Python coding style by flake8 ..."
@flake8
@echo "Passed"
test: dev-requires
python3 -m pytest --cov=piperider_cli --cov-report html tests
pre-release: dev-requires
pip install build
python3 -m build
python3 -m twine upload --repository testpypi dist/*
release: dev-requires
pip install build
python3 -m build
python3 -m twine upload dist/*
require-%:
@if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi
bump-version: require-VERSION
@echo "Bumping version to ${VERSION}"
@echo "${VERSION}" > piperider_cli/VERSION
docker-build: require-VERSION
$(DOCKER_BUILD_CMD) --build-arg PIPERIDER_VERSION=${VERSION} -t piperider:${VERSION} .
docker-deploy: docker-build
docker tag piperider:${VERSION} piperider/piperider:${VERSION}
docker push piperider/piperider:${VERSION}
docker-deploy-latest: docker-build
docker tag piperider:${VERSION} piperider/piperider:latest
docker push piperider/piperider:latest
generate-cli-docs:
@python3 -m piperider_cli.docgen