forked from SeleniumHQ/docker-selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
160 lines (131 loc) · 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
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
NAME := selenium
VERSION := $(or $(VERSION),$(VERSION),'2.53.0')
PLATFORM := $(shell uname -s)
BUILD_ARGS := $(BUILD_ARGS)
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 test
base:
cd ./Base && docker build $(BUILD_ARGS) -t $(NAME)/base:$(VERSION) .
generate_hub:
cd ./Hub && ./generate.sh $(VERSION)
hub: base generate_hub
cd ./Hub && docker build $(BUILD_ARGS) -t $(NAME)/hub:$(VERSION) .
generate_nodebase:
cd ./NodeBase && ./generate.sh $(VERSION)
nodebase: base generate_nodebase
cd ./NodeBase && docker build $(BUILD_ARGS) -t $(NAME)/node-base:$(VERSION) .
generate_chrome:
cd ./NodeChrome && ./generate.sh $(VERSION)
chrome: nodebase generate_chrome
cd ./NodeChrome && docker build $(BUILD_ARGS) -t $(NAME)/node-chrome:$(VERSION) .
generate_firefox:
cd ./NodeFirefox && ./generate.sh $(VERSION)
firefox: nodebase generate_firefox
cd ./NodeFirefox && docker build $(BUILD_ARGS) -t $(NAME)/node-firefox:$(VERSION) .
generate_standalone_firefox:
cd ./Standalone && ./generate.sh StandaloneFirefox node-firefox Firefox $(VERSION)
standalone_firefox: generate_standalone_firefox firefox
cd ./StandaloneFirefox && docker build $(BUILD_ARGS) -t $(NAME)/standalone-firefox:$(VERSION) .
generate_standalone_firefox_debug:
cd ./StandaloneDebug && ./generate.sh StandaloneFirefoxDebug standalone-firefox Firefox $(VERSION)
standalone_firefox_debug: generate_standalone_firefox_debug standalone_firefox
cd ./StandaloneFirefoxDebug && docker build $(BUILD_ARGS) -t $(NAME)/standalone-firefox-debug:$(VERSION) .
generate_standalone_chrome:
cd ./Standalone && ./generate.sh StandaloneChrome node-chrome Chrome $(VERSION)
standalone_chrome: generate_standalone_chrome chrome
cd ./StandaloneChrome && docker build $(BUILD_ARGS) -t $(NAME)/standalone-chrome:$(VERSION) .
generate_standalone_chrome_debug:
cd ./StandaloneDebug && ./generate.sh StandaloneChromeDebug standalone-chrome Chrome $(VERSION)
standalone_chrome_debug: generate_standalone_chrome_debug standalone_chrome
cd ./StandaloneChromeDebug && docker build $(BUILD_ARGS) -t $(NAME)/standalone-chrome-debug:$(VERSION) .
generate_chrome_debug:
cd ./NodeDebug && ./generate.sh NodeChromeDebug node-chrome Chrome $(VERSION)
chrome_debug: generate_chrome_debug chrome
cd ./NodeChromeDebug && docker build $(BUILD_ARGS) -t $(NAME)/node-chrome-debug:$(VERSION) .
generate_firefox_debug:
cd ./NodeDebug && ./generate.sh NodeFirefoxDebug node-firefox Firefox $(VERSION)
firefox_debug: generate_firefox_debug firefox
cd ./NodeFirefoxDebug && docker build $(BUILD_ARGS) -t $(NAME)/node-firefox-debug:$(VERSION) .
tag_latest:
docker tag $(NAME)/base:$(VERSION) $(NAME)/base:latest
docker tag $(NAME)/hub:$(VERSION) $(NAME)/hub:latest
docker tag $(NAME)/node-base:$(VERSION) $(NAME)/node-base:latest
docker tag $(NAME)/node-chrome:$(VERSION) $(NAME)/node-chrome:latest
docker tag $(NAME)/node-firefox:$(VERSION) $(NAME)/node-firefox:latest
docker tag $(NAME)/node-chrome-debug:$(VERSION) $(NAME)/node-chrome-debug:latest
docker tag $(NAME)/node-firefox-debug:$(VERSION) $(NAME)/node-firefox-debug:latest
docker tag $(NAME)/standalone-chrome:$(VERSION) $(NAME)/standalone-chrome:latest
docker tag $(NAME)/standalone-firefox:$(VERSION) $(NAME)/standalone-firefox:latest
docker tag $(NAME)/standalone-chrome-debug:$(VERSION) $(NAME)/standalone-chrome-debug:latest
docker tag $(NAME)/standalone-firefox-debug:$(VERSION) $(NAME)/standalone-firefox-debug:latest
release: tag_latest
@if ! docker images $(NAME)/base | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/base version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/hub | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/hub version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/node-base | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/node-base version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/node-chrome | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/node-chrome version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/node-firefox | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/node-firefox version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/node-chrome-debug | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/node-chrome-debug version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/node-firefox-debug | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/node-firefox-debug version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/standalone-chrome | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/standalone-chrome version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/standalone-firefox | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/standalone-firefox version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/standalone-chrome-debug | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/standalone-chrome-debug version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/standalone-firefox-debug | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/standalone-firefox-debug version $(VERSION) is not yet built. Please run 'make build'"; false; fi
docker push $(NAME)/base
docker push $(NAME)/hub
docker push $(NAME)/node-base
docker push $(NAME)/node-chrome
docker push $(NAME)/node-firefox
docker push $(NAME)/node-chrome-debug
docker push $(NAME)/node-firefox-debug
docker push $(NAME)/standalone-chrome
docker push $(NAME)/standalone-chrome
docker push $(NAME)/standalone-firefox
docker push $(NAME)/standalone-chrome-debug
docker push $(NAME)/standalone-firefox-debug
@echo "*** Don't forget to create a tag. git tag rel-$(VERSION) && git push origin rel-$(VERSION)"
test:
./test.sh
./sa-test.sh
./test.sh debug
./sa-test.sh debug
.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 \
test