-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
105 lines (82 loc) · 1.99 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
SHELL=/bin/bash
PACKAGE_NAME=docker-image-updater
OWNER?=ucphhpc
SERVICE_NAME=${PACKAGE_NAME}
IMAGE=${PACKAGE_NAME}
# Enable that the builder should use buildkit
# https://docs.docker.com/develop/develop-images/build_enhancements/
DOCKER_BUILDKIT=1
# NOTE: dynamic lookup with docker as default and fallback to podman
DOCKER = $(shell which docker 2>/dev/null || which podman 2>/dev/null)
# if docker compose plugin is not available, try old docker-compose/podman-compose
ifeq (, $(shell ${DOCKER} help|grep compose))
DOCKER_COMPOSE = $(shell which docker-compose 2>/dev/null || which podman-compose 2>/dev/null)
else
DOCKER_COMPOSE = ${DOCKER} compose
endif
$(echo ${DOCKER_COMPOSE} >/dev/null)
-include .env
ARGS=
.PHONY: all
all: .env dockerbuild
.env:
@echo
@echo "*** No environment selected - using default ***"
@echo
ln -s defaults.env .env
@sleep 2
.PHONY: build
build: dockerbuild
.PHONY: dockerbuild
dockerbuild:
${DOCKER_COMPOSE} build ${ARGS}
.PHONY: dockerclean
dockerclean:
docker rmi -f $(OWNER)/$(IMAGE):$(TAG)
.PHONY: dockerpush
dockerpush:
docker push $(OWNER)/$(IMAGE):$(TAG)
.PHONY: deamon
daemon:
docker stack deploy -c <(${DOCKER_COMPOSE} config) ${SERVICE_NAME} $(ARGS)
daemon-down:
docker stack rm $(SERVICE_NAME)
.PHONY: up
up:
${DOCKER_COMPOSE} up -d $(ARGS)
.PHONY: down
down:
${DOCKER_COMPOSE} down $(ARGS)
.PHONY: clean
clean: dockerclean distclean
rm -fr .env
rm -fr .pytest_cache
rm -fr tests/__pycache__
.PHONY: dist
dist:
### PLACEHOLDER ###
.PHONY: distclean
distclean:
### PLACEHOLDER ###
.PHONY: maintainer-clean
maintainer-clean:
@echo 'This command is intended for maintainers to use; it'
@echo 'deletes files that may need special tools to rebuild.'
.PHONY: install-dep
install-dep:
### PLACEHOLDER ###
.PHONY: install
install: install-dep
### PLACEHOLDER ###
.PHONY: uninstall
uninstall:
### PLACEHOLDER ###
.PHONY: uninstalltest
uninstalltest:
### PLACEHOLDER ###
.PHONY: installtest
installtest:
### PLACEHOLDER ###
.PHONY: test
test:
### PLACEHOLDER ###