forked from eclipse-cbi/jiro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (66 loc) · 3.75 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
#*******************************************************************************
# Copyright (c) 2018 Eclipse Foundation and others.
# This program and the accompanying materials are made available
# under the terms of the Eclipse Public License 2.0
# which is available at http://www.eclipse.org/legal/epl-v20.html,
# or the MIT License which is available at https://opensource.org/licenses/MIT.
# SPDX-License-Identifier: EPL-2.0 OR MIT
#*******************************************************************************
DOCKER_REPO=`cat repositoryName`
INSTANCES=$(patsubst instances/%,%,$(wildcard instances/*))
IMAGE_INSTANCES=$(patsubst %,image_%,$(INSTANCES))
K8S_INSTANCES=$(patsubst %,k8s_%,$(INSTANCES))
PUSH_INSTANCES=$(patsubst %,push_%,$(INSTANCES))
DEPLOY_INSTANCES=$(patsubst %,deploy_%,$(INSTANCES))
CLEAN_INSTANCES=$(patsubst %,clean_%,$(INSTANCES))
DELETE_INSTANCES=$(patsubst %,delete_%,$(INSTANCES))
GENCONFIG_INSTANCES=$(patsubst %,genconfig_%,$(INSTANCES))
.PHONY: all clean all_images push_all_images k8s_all_instances deploy_all_instances clean_all_instances tests openshift-java push_openshift-java jenkins-master-base push_jenkins-master-base jenkins-agent push_jenkins-agent $(IMAGE_INSTANCES) $(K8S_INSTANCES) $(PUSH_INSTANCES) $(DEPLOY_INSTANCES) $(CLEAN_INSTANCES) $(DELETE_INSTANCES) $(GENCONFIG_INSTANCES) error_resources error_pages deploy_error_pages
error_resources:
./build/dockerw build "eclipsecbijenkins/error_resources" "latest" "./error_pages/resources.Dockerfile"
./build/dockerw push "eclipsecbijenkins/error_resources" "latest"
error_pages: error_resources
./build/dockerw build "eclipsecbijenkins/maintenance_page" "latest" "./error_pages/maintenance.Dockerfile"
./build/dockerw push "eclipsecbijenkins/maintenance_page" "latest"
deploy_error_pages: error_pages
oc apply -f ./error_pages/resources.pod.yml
oc apply -f ./error_pages/maintenance.pod.yml
openshift-java:
./build/dockerw build_all ${DOCKER_REPO} $@
push_openshift-java: openshift-java
./build/dockerw push_all ${DOCKER_REPO} $<
jenkins-agent: openshift-java
find jenkins-agent-images/jenkins-agent -mindepth 1 -maxdepth 1 -type d -exec jenkins-agent-images/jenkins-agent/build.sh {} \;
push_jenkins-agent: jenkins-agent
./build/dockerw push_all ${DOCKER_REPO} jenkins-agent-images/$<
jenkins-master-base: openshift-java
find jenkins-master-base -mindepth 1 -maxdepth 1 -type d -exec jenkins-master-base/build.sh {} \;
push_jenkins-master-base: jenkins-master-base
./build/dockerw push_all ${DOCKER_REPO} $<
# requires push_jenkins-agent to get jenkins-agent sha
$(GENCONFIG_INSTANCES): genconfig_% : templates/default.json.hbs instances/%/config.json push_jenkins-agent
./build/gen-config.sh instances/$(patsubst genconfig_%,%,$@)
$(IMAGE_INSTANCES): image_% : jenkins-master-base genconfig_%
./build/build-image.sh instances/$(patsubst image_%,%,$@)
all_images: $(IMAGE_INSTANCES)
$(PUSH_INSTANCES): push_% : image_%
./build/push-image.sh instances/$(patsubst push_%,%,$@)
push_all_images: push_openshift-java push_jenkins-master-base push_jenkins-agent $(PUSH_INSTANCES)
$(K8S_INSTANCES): k8s_% : push_%
./build/gen-k8s.sh instances/$(patsubst k8s_%,%,$@)
k8s_all_instances: $(K8S_INSTANCES)
$(DEPLOY_INSTANCES): deploy_% : k8s_%
./build/k8s-deploy.sh instances/$(patsubst deploy_%,%,$@)
deploy_all_instances: $(DEPLOY_INSTANCES)
$(CLEAN_INSTANCES): clean_% : genconfig_%
./build/clean-instance.sh instances/$(patsubst clean_%,%,$@)
clean_all_instances: $(CLEAN_INSTANCES)
./build/dockerw rmi_all ${DOCKER_REPO}/jenkins-master-base
./build/dockerw rmi_all ${DOCKER_REPO}/openshift-java
$(DELETE_INSTANCES):
./build/k8s-delete.sh instances/$(patsubst delete_%,%,$@)
tests: jenkins-master-base
./tests/run.sh
all: deploy_all_instances
clean: clean_all_instances
./build/dockerw clean