forked from MontFerret/worker
/
Makefile
72 lines (58 loc) · 1.32 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
default: compile start
compile:
go build -o=./bin/worker ./main.go
start:
./bin/worker
release:
ifeq ($(RELEASE_VERSION), )
$(error "Release version is required (version=x)")
else ifeq ($(GITHUB_TOKEN), )
$(error "GitHub token is required (GITHUB_TOKEN)")
else
rm -rf ./dist && \
git tag -a v$(RELEASE_VERSION) -m "New $(RELEASE_VERSION) version" && \
git push origin v$(RELEASE_VERSION) && \
goreleaser
endif
PYTHONPATH=.
SCRIPTS=scripts/
TESTS_UNIT=abc_storage/tests/
TESTS_INTEGRATION=tests/
REQUIREMENTS=requirements
DOCKER_COMPOSE_FULL=deployments/docker-compose.full.yml
DOCKER=docker
ifndef PYTHON
PYTHON=python
endif
ifndef DOCKER_COMPOSE
DOCKER_COMPOSE=docker-compose
endif
ifndef PYTEST
PYTEST=pytest
endif
ifndef PIP
PIP=pip
endif
ifndef TEST_SUBFOLDER
TEST_SUBFOLDER=./
endif
ifndef VAULT_ENV
VAULT_ENV=LOCAL
endif
ENVS=PYTHONPATH=${PYTHONPATH} ENV_FILE=${ENV_FILE}
.PHONY: publish clean build deps
deps:
$(info $(ENVS))
$(PIP) install -r $(REQUIREMENTS)
build:
$(PYTHON) setup.py bdist_wheel
$(DOCKER) build -t crawler-parser-service .
publish:
$(DOCKER) login 84.201.142.193:5000
$(DOCKER) tag $(TAG) 84.201.142.193:5000/crawler-parser-service:$(VERSION)
$(DOCKER) push 84.201.142.193:5000/crawler-parser-service:$(VERSION)
clean:
$(info $(ENVS))
rm -rf build/
rm -rf dist/
rm -rf abc_storage.egg-info