-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
70 lines (52 loc) · 2.1 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
DOCKER_REGISTRY := $(or $(DOCKER_REGISTRY),$(REGISTRY_HOST))
VALUES_REGISTRY_TMPL := $(or $(VALUES_REGISTRY_TMPL), values-registry.tmpl)
.EXPORT_ALL_VARIABLES:
AC_TAG := 7.1.0-M10
APA_TAG := 7.1.0-M10
APW_TAG := 7.1.0-M10
ADW_TAG := 7.1.0-M10
RABBITMQ_TAG := 3.7-alpine
POSTGRESQL_TAG := 10.7.0
ALPINE_TAG := 3.8
BUSYBOX_TAG := 1.30.1
MINIDEB_TAG := stretch
IMAGES := activiti/example-cloud-connector@$(AC_TAG) \
quay.io/alfresco/alfresco-process-runtime-bundle-service@$(APA_TAG) \
quay.io/alfresco/alfresco-process-query-service@$(APA_TAG) \
quay.io/alfresco/alfresco-admin-app@$(APA_TAG) \
quay.io/alfresco/alfresco-process-workspace-app@$(APW_TAG) \
quay.io/alfresco/alfresco-digital-workspace-app@$(ADW_TAG) \
alpine@$(ALPINE_TAG) \
bitnami/postgresql@$(POSTGRESQL_TAG) \
bitnami/minideb@$(MINIDEB_TAG) \
busybox@$(BUSYBOX_TAG) \
rabbitmq@$(RABBITMQ_TAG)
.PHONY: $(IMAGES)
all: images values
test:
@if test -z "$(DOCKER_REGISTRY)"; then echo "Error: missing DOCKER_REGISTRY argument or env variable."; exit 1; fi
login: test
docker login quay.io
docker login $(DOCKER_REGISTRY)
pull: $(foreach image,$(IMAGES),$(image)\pull)
tag: test $(foreach image,$(IMAGES),$(image)\tag)
push: test $(foreach image,$(IMAGES),$(image)\push)
images: test pull tag push
values-registry.yaml: test
@envsubst < $(VALUES_REGISTRY_TMPL) > values-registry.yaml
@echo Values generated in values-registry.yaml
list: $(foreach image,$(IMAGES),$(image)\print)
clean:
rm values-registry.yaml || true
$(foreach image,$(IMAGES),$(image)\pull): ## Pull container image
$(eval IMAGE := $(subst \, ,$@))
docker pull $(word 1, $(subst @,:,$(IMAGE)))
$(foreach image,$(IMAGES),$(image)\tag): ## Tag container image
$(eval IMAGE := $(subst \, ,$@))
docker tag $(word 1, $(subst @,:,$(IMAGE))) $(DOCKER_REGISTRY)/$(word 1, $(subst @,:,$(IMAGE)))
$(foreach image,$(IMAGES),$(image)\push): ## Push container image
$(eval IMAGE := $(subst \, ,$@))
docker push $(DOCKER_REGISTRY)/$(word 1, $(subst @,:,$(IMAGE)))
$(foreach image,$(IMAGES),$(image)\print): ## Print container image
$(eval IMAGE := $(subst \, ,$@))
@echo $(word 1, $(subst @,:,$(IMAGE)))