forked from SeleniumHQ/docker-selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
237 lines (207 loc) · 14.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
NAME := $(or $(NAME),$(NAME),urosporo)
VERSION := $(or $(VERSION),$(VERSION),5.1.2)
NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME))
AUTHORS := $(or $(AUTHORS),$(AUTHORS),Urosporo)
PLATFORM := $(shell uname -s)
BUILD_ARGS := $(BUILD_ARGS)
MAJOR := $(word 1,$(subst ., ,$(VERSION)))
MINOR := $(word 2,$(subst ., ,$(VERSION)))
MAJOR_MINOR_PATCH := $(word 1,$(subst -, ,$(VERSION)))
all: hub chrome firefox chrome_debug firefox_debug standalone_chrome standalone_firefox standalone_chrome_debug standalone_firefox_debug
generate_all: \
generate_hub \
generate_nodebase \
generate_chrome \
generate_firefox \
generate_chrome_debug \
generate_firefox_debug \
generate_standalone_firefox \
generate_standalone_chrome \
generate_standalone_firefox_debug \
generate_standalone_chrome_debug
build: all
ci: build
base:
cd ./Base && docker build $(BUILD_ARGS) -t $(NAME)/testbench-base:$(VERSION) .
generate_hub:
cd ./Hub && ./generate.sh $(VERSION) $(NAMESPACE) $(AUTHORS)
hub: base generate_hub
cd ./Hub && docker build $(BUILD_ARGS) -t $(NAME)/testbench-hub:$(VERSION) .
generate_nodebase:
cd ./NodeBase && ./generate.sh $(VERSION) $(NAMESPACE) $(AUTHORS)
nodebase: base generate_nodebase
cd ./NodeBase && docker build $(BUILD_ARGS) -t $(NAME)/testbench-node-base:$(VERSION) .
generate_chrome:
cd ./NodeChrome && ./generate.sh $(VERSION) $(NAMESPACE) $(AUTHORS)
chrome: nodebase generate_chrome
cd ./NodeChrome && docker build $(BUILD_ARGS) -t $(NAME)/testbench-node-chrome:$(VERSION) .
generate_firefox:
cd ./NodeFirefox && ./generate.sh $(VERSION) $(NAMESPACE) $(AUTHORS)
firefox: nodebase generate_firefox
cd ./NodeFirefox && docker build $(BUILD_ARGS) -t $(NAME)/testbench-node-firefox:$(VERSION) .
generate_standalone_firefox:
cd ./Standalone && ./generate.sh StandaloneFirefox testbench-node-firefox Firefox $(VERSION) $(NAMESPACE) $(AUTHORS)
standalone_firefox: firefox generate_standalone_firefox
cd ./StandaloneFirefox && docker build $(BUILD_ARGS) -t $(NAME)/testbench-standalone-firefox:$(VERSION) .
generate_standalone_firefox_debug:
cd ./StandaloneDebug && ./generate.sh StandaloneFirefoxDebug testbench-node-firefox-debug Firefox $(VERSION) $(NAMESPACE) $(AUTHORS)
standalone_firefox_debug: firefox_debug generate_standalone_firefox_debug
cd ./StandaloneFirefoxDebug && docker build $(BUILD_ARGS) -t $(NAME)/testbench-standalone-firefox-debug:$(VERSION) .
generate_standalone_chrome:
cd ./Standalone && ./generate.sh StandaloneChrome testbench-node-chrome Chrome $(VERSION) $(NAMESPACE) $(AUTHORS)
standalone_chrome: chrome generate_standalone_chrome
cd ./StandaloneChrome && docker build $(BUILD_ARGS) -t $(NAME)/testbench-standalone-chrome:$(VERSION) .
generate_standalone_chrome_debug:
cd ./StandaloneDebug && ./generate.sh StandaloneChromeDebug testbench-node-chrome-debug Chrome $(VERSION) $(NAMESPACE) $(AUTHORS)
standalone_chrome_debug: chrome_debug generate_standalone_chrome_debug
cd ./StandaloneChromeDebug && docker build $(BUILD_ARGS) -t $(NAME)/testbench-standalone-chrome-debug:$(VERSION) .
generate_chrome_debug:
cd ./NodeDebug && ./generate.sh NodeChromeDebug testbench-node-chrome Chrome $(VERSION) $(NAMESPACE) $(AUTHORS)
chrome_debug: generate_chrome_debug chrome
cd ./NodeChromeDebug && docker build $(BUILD_ARGS) -t $(NAME)/testbench-node-chrome-debug:$(VERSION) .
generate_firefox_debug:
cd ./NodeDebug && ./generate.sh NodeFirefoxDebug testbench-node-firefox Firefox $(VERSION) $(NAMESPACE) $(AUTHORS)
firefox_debug: generate_firefox_debug firefox
cd ./NodeFirefoxDebug && docker build $(BUILD_ARGS) -t $(NAME)/testbench-node-firefox-debug:$(VERSION) .
tag_latest:
docker tag $(NAME)/testbench-base:$(VERSION) $(NAME)/testbench-base:latest
docker tag $(NAME)/testbench-hub:$(VERSION) $(NAME)/testbench-hub:latest
docker tag $(NAME)/node-base:$(VERSION) $(NAME)/testbench-node-base:latest
docker tag $(NAME)/testbench-node-chrome:$(VERSION) $(NAME)/testbench-node-chrome:latest
docker tag $(NAME)/testbench-node-firefox:$(VERSION) $(NAME)/testbench-node-firefox:latest
docker tag $(NAME)/testbench-node-chrome-debug:$(VERSION) $(NAME)/testbench-node-chrome-debug:latest
docker tag $(NAME)/testbench-node-firefox-debug:$(VERSION) $(NAME)/testbench-node-firefox-debug:latest
docker tag $(NAME)/testbench-standalone-chrome:$(VERSION) $(NAME)/testbench-standalone-chrome:latest
docker tag $(NAME)/testbench-standalone-firefox:$(VERSION) $(NAME)/testbench-standalone-firefox:latest
docker tag $(NAME)/testbench-standalone-chrome-debug:$(VERSION) $(NAME)/testbench-standalone-chrome-debug:latest
docker tag $(NAME)/testbench-standalone-firefox-debug:$(VERSION) $(NAME)/testbench-standalone-firefox-debug:latest
release_latest:
docker push $(NAME)/testbench-base:latest
docker push $(NAME)/testbench-hub:latest
docker push $(NAME)/testbench-node-base:latest
docker push $(NAME)/testbench-node-chrome:latest
docker push $(NAME)/testbench-node-firefox:latest
docker push $(NAME)/testbench-node-chrome-debug:latest
docker push $(NAME)/testbench-node-firefox-debug:latest
docker push $(NAME)/testbench-standalone-chrome:latest
docker push $(NAME)/testbench-standalone-firefox:latest
docker push $(NAME)/testbench-standalone-chrome-debug:latest
docker push $(NAME)/testbench-standalone-firefox-debug:latest
tag_major_minor:
docker tag $(NAME)/testbench-base:$(VERSION) $(NAME)/testbench-base:$(MAJOR)
docker tag $(NAME)/testbench-hub:$(VERSION) $(NAME)/testbench-hub:$(MAJOR)
docker tag $(NAME)/testbench-node-base:$(VERSION) $(NAME)/testbench-node-base:$(MAJOR)
docker tag $(NAME)/testbench-node-chrome:$(VERSION) $(NAME)/testbench-node-chrome:$(MAJOR)
docker tag $(NAME)/testbench-node-firefox:$(VERSION) $(NAME)/testbench-node-firefox:$(MAJOR)
docker tag $(NAME)/testbench-node-chrome-debug:$(VERSION) $(NAME)/testbench-node-chrome-debug:$(MAJOR)
docker tag $(NAME)/testbench-node-firefox-debug:$(VERSION) $(NAME)/testbench-node-firefox-debug:$(MAJOR)
docker tag $(NAME)/testbench-standalone-chrome:$(VERSION) $(NAME)/testbench-standalone-chrome:$(MAJOR)
docker tag $(NAME)/testbench-standalone-firefox:$(VERSION) $(NAME)/testbench-standalone-firefox:$(MAJOR)
docker tag $(NAME)/testbench-standalone-chrome-debug:$(VERSION) $(NAME)/testbench-standalone-chrome-debug:$(MAJOR)
docker tag $(NAME)/testbench-standalone-firefox-debug:$(VERSION) $(NAME)/testbench-standalone-firefox-debug:$(MAJOR)
docker tag $(NAME)/testbench-base:$(VERSION) $(NAME)/testbench-base:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-hub:$(VERSION) $(NAME)/testbench-hub:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-node-base:$(VERSION) $(NAME)/testbench-node-base:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-node-chrome:$(VERSION) $(NAME)/testbench-node-chrome:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-node-firefox:$(VERSION) $(NAME)/testbench-node-firefox:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-node-chrome-debug:$(VERSION) $(NAME)/testbench-node-chrome-debug:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-node-firefox-debug:$(VERSION) $(NAME)/testbench-node-firefox-debug:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-standalone-chrome:$(VERSION) $(NAME)/testbench-standalone-chrome:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-standalone-firefox:$(VERSION) $(NAME)/testbench-standalone-firefox:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-standalone-chrome-debug:$(VERSION) $(NAME)/testbench-standalone-chrome-debug:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-standalone-firefox-debug:$(VERSION) $(NAME)/testbench-standalone-firefox-debug:$(MAJOR).$(MINOR)
docker tag $(NAME)/testbench-base:$(VERSION) $(NAME)/testbench-base:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/testbench-hub:$(VERSION) $(NAME)/testbench-hub:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/testbench-node-base:$(VERSION) $(NAME)/testbench-node-base:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/testbench-node-chrome:$(VERSION) $(NAME)/testbench-node-chrome:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/testbench-node-firefox:$(VERSION) $(NAME)/testbench-node-firefox:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/testbench-node-chrome-debug:$(VERSION) $(NAME)/testbench-node-chrome-debug:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/testbench-node-firefox-debug:$(VERSION) $(NAME)/testbench-node-firefox-debug:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/testbench-standalone-chrome:$(VERSION) $(NAME)/testbench-standalone-chrome:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/testbench-standalone-firefox:$(VERSION) $(NAME)/testbench-standalone-firefox:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/testbench-standalone-chrome-debug:$(VERSION) $(NAME)/testbench-standalone-chrome-debug:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/testbench-standalone-firefox-debug:$(VERSION) $(NAME)/testbench-standalone-firefox-debug:$(MAJOR_MINOR_PATCH)
release: tag_major_minor
@if ! docker images $(NAME)/testbench-base | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-base version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/testbench-hub | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-hub version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/testbench-node-base | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-node-base version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/testbench-node-chrome | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-node-chrome version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/testbench-node-firefox | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-node-firefox version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/testbench-node-chrome-debug | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-node-chrome-debug version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/testbench-node-firefox-debug | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-node-firefox-debug version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/testbench-standalone-chrome | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-standalone-chrome version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/testbench-standalone-firefox | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-standalone-firefox version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/testbench-standalone-chrome-debug | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-standalone-chrome-debug version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/testbench-standalone-firefox-debug | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/testbench-standalone-firefox-debug version $(VERSION) is not yet built. Please run 'make build'"; false; fi
docker push $(NAME)/testbench-base:$(VERSION)
docker push $(NAME)/testbench-hub:$(VERSION)
docker push $(NAME)/testbench-node-base:$(VERSION)
docker push $(NAME)/testbench-node-chrome:$(VERSION)
docker push $(NAME)/testbench-node-firefox:$(VERSION)
docker push $(NAME)/testbench-node-chrome-debug:$(VERSION)
docker push $(NAME)/testbench-node-firefox-debug:$(VERSION)
docker push $(NAME)/testbench-standalone-chrome:$(VERSION)
docker push $(NAME)/testbench-standalone-firefox:$(VERSION)
docker push $(NAME)/testbench-standalone-chrome-debug:$(VERSION)
docker push $(NAME)/testbench-standalone-firefox-debug:$(VERSION)
docker push $(NAME)/testbench-base:$(MAJOR)
docker push $(NAME)/testbench-hub:$(MAJOR)
docker push $(NAME)/testbench-node-base:$(MAJOR)
docker push $(NAME)/testbench-node-chrome:$(MAJOR)
docker push $(NAME)/testbench-node-firefox:$(MAJOR)
docker push $(NAME)/testbench-node-chrome-debug:$(MAJOR)
docker push $(NAME)/testbench-node-firefox-debug:$(MAJOR)
docker push $(NAME)/testbench-standalone-chrome:$(MAJOR)
docker push $(NAME)/testbench-standalone-firefox:$(MAJOR)
docker push $(NAME)/testbench-standalone-chrome-debug:$(MAJOR)
docker push $(NAME)/testbench-standalone-firefox-debug:$(MAJOR)
docker push $(NAME)/testbench-base:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-hub:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-node-base:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-node-chrome:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-node-firefox:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-node-chrome-debug:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-node-firefox-debug:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-standalone-chrome:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-standalone-firefox:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-standalone-chrome-debug:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-standalone-firefox-debug:$(MAJOR).$(MINOR)
docker push $(NAME)/testbench-base:$(MAJOR_MINOR_PATCH)
docker push $(NAME)/testbench-hub:$(MAJOR_MINOR_PATCH)
docker push $(NAME)/testbench-node-base:$(MAJOR_MINOR_PATCH)
docker push $(NAME)/testbench-node-chrome:$(MAJOR_MINOR_PATCH)
docker push $(NAME)/testbench-node-firefox:$(MAJOR_MINOR_PATCH)
docker push $(NAME)/testbench-node-chrome-debug:$(MAJOR_MINOR_PATCH)
docker push $(NAME)/testbench-node-firefox-debug:$(MAJOR_MINOR_PATCH)
docker push $(NAME)/testbench-standalone-chrome:$(MAJOR_MINOR_PATCH)
docker push $(NAME)/testbench-standalone-firefox:$(MAJOR_MINOR_PATCH)
docker push $(NAME)/testbench-standalone-chrome-debug:$(MAJOR_MINOR_PATCH)
docker push $(NAME)/testbench-standalone-firefox-debug:$(MAJOR_MINOR_PATCH)
.PHONY: \
all \
base \
build \
chrome \
chrome_debug \
ci \
firefox \
firefox_debug \
generate_all \
generate_hub \
generate_nodebase \
generate_chrome \
generate_firefox \
generate_chrome_debug \
generate_firefox_debug \
generate_standalone_chrome \
generate_standalone_firefox \
generate_standalone_chrome_debug \
generate_standalone_firefox_debug \
hub \
nodebase \
release \
standalone_chrome \
standalone_firefox \
standalone_chrome_debug \
standalone_firefox_debug \
tag_latest