This repository has been archived by the owner on Mar 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
120 lines (110 loc) · 2.76 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
.PHONY: build test docker help stage release clean
ifndef VERBOSE
.SILENT: build test docker help stage release clean
endif
all: help
@:
.PHONY: help
help:
echo "\nUsage: make [action] [target]\n" && \
echo "Actions:" && \
echo " - build - build docker images locally" && \
echo " - test - test images locally" && \
echo " - stage - push images to staging environment" && \
echo " - release - push images to production environment\n" && \
echo "Targets:" && \
echo " - base - Recipe in images/base" && \
echo " - sd2e - Recipe in images/sd2e which is where all community software should belong" && \
echo " - singularity - Image for running on TACC HPC" && \
echo " - ml - Image for running ML on TACC HPC\n"
# Make sure image targets are not used as make targets
%:
@:
docker:
docker info 1> /dev/null 2> /dev/null && \
if [ ! $$? -eq 0 ]; then \
echo "\n[ERROR] Could not communicate with docker daemon. You may need to run with sudo.\n"; \
exit 1; \
fi
build: docker
TARGET=$(filter-out $@,$(MAKECMDGOALS)) && \
case $${TARGET} in \
base) \
build/build_jupyteruser.sh build images/base; \
;; \
sd2e) \
build/build_jupyteruser.sh build images/sd2e; \
;; \
singularity) \
build/build_jupyteruser.sh build images/singularity; \
;; \
ml) \
build/build_jupyteruser.sh build images/ml; \
;; \
*) \
$(MAKE) help; \
;; \
esac
test: docker
TARGET=$(filter-out $@,$(MAKECMDGOALS)) && \
case $$TARGET in \
base) \
build/build_jupyteruser.sh test images/base; \
;; \
sd2e) \
build/build_jupyteruser.sh test images/sd2e; \
;; \
singularity) \
build/build_jupyteruser.sh test images/singularity; \
;; \
ml) \
build/build_jupyteruser.sh test images/ml; \
;; \
*) \
$(MAKE) help; \
;; \
esac
stage: docker
TARGET=$(filter-out $@,$(MAKECMDGOALS)) && \
case $$TARGET in \
base) \
build/build_jupyteruser.sh stage images/base; \
;; \
sd2e) \
build/build_jupyteruser.sh stage images/sd2e; \
;; \
singularity) \
build/build_jupyteruser.sh stage images/singularity; \
;; \
ml) \
build/build_jupyteruser.sh stage images/ml; \
;; \
*) \
$(MAKE) help; \
;; \
esac
release: docker
TARGET=$(filter-out $@,$(MAKECMDGOALS)) && \
case $$TARGET in \
base) \
build/build_jupyteruser.sh release images/base; \
;; \
sd2e) \
build/build_jupyteruser.sh release images/sd2e; \
;; \
singularity) \
build/build_jupyteruser.sh release images/singularity; \
;; \
ml) \
build/build_jupyteruser.sh release images/ml; \
;; \
*) \
$(MAKE) help; \
;; \
esac
clean: docker
TARGET=$(filter-out $@,$(MAKECMDGOALS)) && \
build/build_jupyteruser.sh clean images/ml && \
build/build_jupyteruser.sh clean images/singularity && \
build/build_jupyteruser.sh clean images/sd2e && \
build/build_jupyteruser.sh clean images/base