-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
48 lines (37 loc) · 1.09 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
-include .creds
BASEIMAGE := xycarto/sea-draining
IMAGE := $(BASEIMAGE):2023-10-09
RUN ?= docker run -it --rm --net=host --user=$$(id -u):$$(id -g) \
-e DISPLAY=$$DISPLAY \
-e HOME=/work \
--env-file .creds \
-e RUN= -v$$(pwd):/work \
-w /work $(IMAGE)
.PHONY:
##### CATCHMENTS #####
select:
$(RUN) python3 src/select-downsample.py
catchment:
$(RUN) bash src/grass-build-catchment.sh
sea-drain:
$(RUN) bash src/grass-build-sea-drain.sh
##### DOCKER #####
test-local: docker/Dockerfile
docker run -it --rm \
--user=$$(id -u):$$(id -g) \
-e DISPLAY=$$DISPLAY \
--env-file .creds \
-e RUN= -v$$(pwd):/work \
-w /work $(IMAGE)
bash
docker-local: docker/Dockerfile
docker build --tag $(BASEIMAGE) - < docker/Dockerfile && \
docker tag $(BASEIMAGE) $(IMAGE)
docker-push: docker/Dockerfile
echo $(DOCKER_PW) | docker login --username xycarto --password-stdin
docker build --tag $(BASEIMAGE) - < docker/Dockerfile && \
docker tag $(BASEIMAGE) $(IMAGE) && \
docker push $(IMAGE)
docker-pull:
echo $(DOCKER_PW) | docker login --username xycarto --password-stdin
docker pull $(IMAGE)