-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
42 lines (36 loc) · 1012 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
DOCKERHOST = docker.io
DOCKERORG = aerogearcatalog
IMAGENAME = keycloak-apb
TAG = latest
APB_TAG = release-1.1
USER=$(shell id -u)
PWD=$(shell pwd)
LAST_COMMIT=$(shell git rev-parse HEAD)
ORIGIN = origin
build_and_push: apb_build docker_push apb_push
.PHONY: minishift_pull
minishift_pull:
minishift ssh -- docker pull $(DOCKERHOST)/$(DOCKERORG)/$(IMAGENAME):$(TAG)
.PHONY: apb_build
apb_build:
apb prepare
docker build -t $(DOCKERHOST)/$(DOCKERORG)/$(IMAGENAME):$(TAG) .
.PHONY: docker_push
docker_push:
docker push $(DOCKERHOST)/$(DOCKERORG)/$(IMAGENAME):$(TAG)
.PHONY: apb_push
apb_push:
apb push
.PHONY: apb_release
apb_release:
ifdef VERSION
@echo "Preparing $(VERSION)"
else
$(error No VERSION defined!)
endif
ifeq ($(shell git ls-files -m | wc -l),0)
@echo 'tagging for $(LAST_COMMIT)'
git tag -a $(VERSION) $(LAST_COMMIT) -m "signing tag" && git push $(ORIGIN) $(VERSION)
else
$(error Aborting release process, since local files are modified)
endif