forked from neo-technology/neo4j-google-k8s-marketplace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
102 lines (86 loc) · 2.7 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
NAME = neo4j
REGISTRY = gcr.io/neo4j-k8s-marketplace-public/causal-cluster
# Solution version
SOLUTION_VERSION=$(shell cat chart/Chart.yaml | grep version: | sed 's/.*: //g')$(BUILD)
TAG=$(SOLUTION_VERSION)
APP_DEPLOYER_IMAGE=$(REGISTRY)/deployer:$(SOLUTION_VERSION)
APP_RESTORE_IMAGE=$(REGISTRY)/restore:$(SOLUTION_VERSION)
APP_BACKUP_IMAGE=$(REGISTRY)/backup:$(SOLUTION_VERSION)
NEO4J_VERSION=3.5.14-enterprise
TESTER_IMAGE = $(REGISTRY)/tester:$(SOLUTION_VERSION)
NAMESPACE ?= default
include ./app.Makefile
include ./crd.Makefile
include ./gcloud.Makefile
include ./var.Makefile
$(info ---- TAG = $(TAG))
APP_NAME ?= testrun
APP_PARAMETERS ?= { \
"name": "$(APP_NAME)", \
"namespace": "$(NAMESPACE)", \
"image": "$(REGISTRY):$(SOLUTION_VERSION)", \
"coreServers": "3", \
"readReplicaServers": "1" \
}
APP_TEST_PARAMETERS ?= { \
"tester.image": "$(TESTER_IMAGE)" \
}
app/build:: .build/neo4j \
.build/neo4j/causal-cluster \
.build/neo4j/deployer \
.build/neo4j/tester \
.build/neo4j/backup \
.build/neo4j/restore
.build/neo4j: | .build
mkdir -p "$@"
.build/neo4j/deployer: schema.yaml \
deployer/* \
chart/* \
chart/templates/* \
apptest/deployer/* \
.build/var/REGISTRY
echo $(SOLUTION_VERSION)
docker build \
--build-arg REGISTRY=$(REGISTRY) \
--build-arg TAG=$(SOLUTION_VERSION) \
--build-arg MARKETPLACE_TOOLS_TAG="$(MARKETPLACE_TOOLS_TAG)" \
--tag "$(APP_DEPLOYER_IMAGE)" \
-f deployer/Dockerfile \
.
docker push "$(APP_DEPLOYER_IMAGE)"
@touch "$@"
.build/neo4j/tester: .build/var/TESTER_IMAGE \
$(shell find apptest -type f) | .build/neo4j
$(call print_target,$@)
docker build \
--tag "$(TESTER_IMAGE)" \
--build-arg MARKETPLACE_TOOLS_TAG="$(MARKETPLACE_TOOLS_TAG)" \
-f apptest/tester/Dockerfile \
.
docker push "$(TESTER_IMAGE)"
@touch "$@"
.build/neo4j/restore: restore/*
docker build \
--tag "$(APP_RESTORE_IMAGE)" \
--build-arg MARKETPLACE_TOOLS_TAG="$(MARKETPLACE_TOOLS_TAG)" \
-f restore/Dockerfile \
.
docker push "$(APP_RESTORE_IMAGE)"
@date >> "$@"
APP_BACKUP_IMAGE=$(REGISTRY)/backup:$(SOLUTION_VERSION)
.build/neo4j/backup: backup/*
docker build \
--tag "$(APP_BACKUP_IMAGE)" \
--build-arg MARKETPLACE_TOOLS_TAG="$(MARKETPLACE_TOOLS_TAG)" \
-f backup/Dockerfile \
.
docker push "$(APP_BACKUP_IMAGE)"
@date >> "$@"
.build/neo4j/causal-cluster: causal-cluster/*
docker pull neo4j:$(NEO4J_VERSION)
docker build --tag $(REGISTRY):$(SOLUTION_VERSION) \
--build-arg NEO4J_VERSION="$(NEO4J_VERSION)" \
--build-arg MARKETPLACE_TOOLS_TAG="$(MARKETPLACE_TOOLS_TAG)" \
-f causal-cluster/Dockerfile \
.
docker push $(REGISTRY):$(SOLUTION_VERSION)