-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
50 lines (38 loc) · 1.47 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_OWNER=gremlin
DOCKER_NAME=gremlin-python-api
DOCKER_IMAGE=$(DOCKER_OWNER)/$(DOCKER_NAME)
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
ENV_VARS=.env
all: docker-build
install:
python3 setup.py install
package:
python3 setup.py sdist bdist_wheel
test:
python3 -m tests.test_all
pytest tests/pytest_*
lint: typecheck
python3 -m black $(PWD)/gremlinapi
python3 -m black $(PWD)/tests
typecheck:
mypy gremlinapi
pypi-test: export TWINE_PASSWORD=$(PYPI_TEST)
pypi-test: package
python3 -m twine upload --non-interactive --config-file ${HOME}/.pypirc --repository testpypi dist/*
pypi-prod: export TWINE_PASSWORD=$(PYPI_PROD)
pypi-prod: package
python3 -m twine upload --non-interactive --config-file ${HOME}/.pypirc dist/*
docker-build:
docker build --no-cache=true \
--build-arg BUILD_DATE=$(BUILD_DATE) \
--build-arg IMAGE_NAME=$(DOCKER_IMAGE) \
-t $(DOCKER_IMAGE):latest \
.
docker-run:
@if ! test -f $(ENV_VARS); then touch $(ENV_VARS); fi
docker run --rm -v ~/.ssh/:/root/.ssh --mount type=bind,source="$(PWD)",target=/opt/gremlin-python \
--env-file=$(ENV_VARS) --name $(DOCKER_NAME) --entrypoint "/bin/ash" $(DOCKER_IMAGE):latest
docker-run-interactive:
@if ! test -f $(ENV_VARS); then touch $(ENV_VARS); fi
docker run -it --rm -v ~/.ssh/:/root/.ssh --mount type=bind,source="$(PWD)",target=/opt/gremlin-python \
--env-file=$(ENV_VARS) --name $(DOCKER_NAME) --entrypoint "/bin/ash" $(DOCKER_IMAGE):latest