-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (21 loc) · 1023 Bytes
/
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
APP_NAME=status-page-web
HASH=$(shell git rev-parse --short HEAD)
CONTAINER_RUNTIME := $(shell command -v docker 2> /dev/null)
ifndef CONTAINER_RUNTIME
CONTAINER_RUNTIME := $(shell command -v podman 2> /dev/null)
endif
.PHONY: all container container-push-harbor
all: container container-push-harbor
container: guard-container-cmd
${CONTAINER_RUNTIME} build -t ${APP_NAME}:latest -t ${APP_NAME}:${HASH} -f Containerfile .
container-push-harbor: guard-container-cmd
${CONTAINER_RUNTIME} tag ${APP_NAME}:${HASH} registry.scs.community/status-page/${APP_NAME}:${HASH}
${CONTAINER_RUNTIME} tag ${APP_NAME}:latest registry.scs.community/status-page/${APP_NAME}:latest
${CONTAINER_RUNTIME} push registry.scs.community/status-page/${APP_NAME}:${HASH}
${CONTAINER_RUNTIME} push registry.scs.community/status-page/${APP_NAME}:latest
# Check, if the CONTAINER_RUNTIME variable is set
guard-container-cmd:
@if [ "${CONTAINER_RUNTIME}" = "" ]; then \
echo "Either DOCKER or PODMAN must be installed"; \
exit 1; \
fi