-
Notifications
You must be signed in to change notification settings - Fork 56
/
Makefile
36 lines (26 loc) · 1.01 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
REGISTRY ?= quay.io
DEFAULT_TAG = latest
IMAGE_NAME ?= bayesian-api
DOCKERFILE := Dockerfile
ifeq ($(TARGET),rhel)
REPOSITORY ?= openshiftio/rhel-bayesian-bayesian-api
else
REPOSITORY ?= openshiftio/bayesian-bayesian-api
endif
.PHONY: all docker-build fast-docker-build test get-image-name get-image-repository coreapi-release
all: fast-docker-build
coreapi-release:
git show -s --format="COMMITTED_AT=%ai%nCOMMIT_HASH=%h%n" HEAD > hack/coreapi-release
git update-index --assume-unchanged hack/coreapi-release
docker-build: coreapi-release
docker build --no-cache -t $(REGISTRY)/$(REPOSITORY):$(DEFAULT_TAG) -f $(DOCKERFILE) .
docker tag $(REGISTRY)/$(REPOSITORY):$(DEFAULT_TAG) $(IMAGE_NAME)
fast-docker-build: coreapi-release
docker build -t $(REGISTRY)/$(REPOSITORY):$(DEFAULT_TAG) -f $(DOCKERFILE) .
docker tag $(REGISTRY)/$(REPOSITORY):$(DEFAULT_TAG) $(IMAGE_NAME)
test: fast-docker-build
./qa/runtest.sh
get-image-name:
@echo $(REGISTRY)/$(REPOSITORY):$(DEFAULT_TAG)
get-image-repository:
@echo $(REPOSITORY)