-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (32 loc) · 1014 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
###################### PlayNet Makefile ######################
NAME := imprint
REPO := playnet-public
GIT_HOST := github.com
REGISTRY := quay.io
IMAGE := playnet/imprint
VERSION := $(shell git describe --tags --always --dirty)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
REVISION := $(shell git rev-parse HEAD)
REVSHORT := $(shell git rev-parse --short HEAD)
USER := $(shell whoami)
NAMESPACE ?= $(NAME)
DOCKER_CACHE ?= --no-cache
DOCKER_TAGS := -t $(REGISTRY)/$(IMAGE):$(VERSION) -t $(REGISTRY)/$(IMAGE):latest
-include .env
.PHONY: build
### MAIN STEPS ###
all: build upload restart clean
run: build
docker run -it --rm -p 8080:80 $(REGISTRY)/$(IMAGE):latest
build:
@docker build $(DOCKER_CACHE) --rm=true $(DOCKER_TAGS) \
-f Dockerfile .
upload:
docker push $(REGISTRY)/$(IMAGE)
restart:
kubectl delete po -n $(NAMESPACE) -lapp=$(NAME)
clean:
docker rmi -f $(shell docker images -q --filter=reference=$(REGISTRY)/$(IMAGE)*)
### HELPER STEPS ###
version:
@echo $(VERSION)