-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMakefile
48 lines (36 loc) · 1013 Bytes
/
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
NAME ?=es-dedupe
REGISTRY ?= deric
all: clean test
build:
grep "^FROM" Dockerfile | awk '{ print $$2 }' | uniq | xargs -P2 -n1 docker pull
docker build -t $(NAME) .
define RELEASE
git tag "v$(1)"
git push
git push --tags
docker tag $(NAME) $(REGISTRY)/$(NAME):v$(1)
docker tag $(NAME) $(REGISTRY)/$(NAME):latest
docker push $(REGISTRY)/$(NAME)
endef
shell: build
docker run --entrypoint /bin/bash -it $(NAME)
release: build
$(call RELEASE,$(v))
dev:
pip3 install -r requirements.txt -r requirements-dev.txt
# auto correct indentation issues
fix:
autopep8 esdedupe/ --recursive --in-place
lint:
flake8 esdedupe/
package:
python3 setup.py sdist bdist_wheel
test:
docker build -f Dockerfile.test -t esdedupe-test .
docker run -v $(shell pwd):/app --entrypoint /bin/bash -it esdedupe-test
clean:
find . -name '*.pyc' -exec rm --force {} +
find . -name '*.pyo' -exec rm --force {} +
find . -name '*~' -exec rm --force {} +
rm -rf esdedupe.egg-info dist build
.PHONY: clean test build