-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
73 lines (52 loc) · 1.6 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
73
# Makefile to manage main tasks
# cf. https://blog.ianpreston.ca/conda/python/bash/2020/05/13/conda_envs.html#makefile
# Oneshell means I can run multiple lines in a recipe in the same shell, so I don't have to
# chain commands together with semicolon
.ONESHELL:
SHELL = /bin/bash
##############################
# Install
##############################
install:
mamba env update -n pdaltools -f environment.yml
##############################
# Dev/Contrib tools
##############################
testing:
python -m pytest ./test -s --log-cli-level DEBUG -m "not geopf"
testing_full:
python -m pytest ./test -s --log-cli-level DEBUG
install-precommit:
pre-commit install
##############################
# Build/deploy pip lib
##############################
deploy: check
twine upload dist/*
check: dist/ign-pdal-tool*.tar.gz
twine check dist/*
dist/ign-pdal-tool*.tar.gz:
python -m build
build: clean
python -m build
clean:
rm -rf tmp
rm -rf ign_pdal_tools.egg-info
rm -rf dist
##############################
# Build/deploy Docker image
##############################
REGISTRY=ghcr.io
NAMESPACE=ignf
IMAGE_NAME=ign-pdal-tools
VERSION=`python -m pdaltools._version`
FULL_IMAGE_NAME=${REGISTRY}/${NAMESPACE}/${IMAGE_NAME}:${VERSION}
docker-build: clean
docker build --no-cache -t ${IMAGE_NAME}:${VERSION} -f Dockerfile .
docker-test:
docker run --rm -it ${IMAGE_NAME}:${VERSION} python -m pytest -s
docker-remove:
docker rmi -f `docker images | grep ${IMAGE_NAME}:${VERSION} | tr -s ' ' | cut -d ' ' -f 3`
docker-deploy:
docker tag ${IMAGE_NAME}:${VERSION} ${FULL_IMAGE_NAME}
docker push ${FULL_IMAGE_NAME}