forked from SeleniumHQ/docker-selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (48 loc) · 2.67 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
NAME := selenium
VERSION := $(or $(VERSION),$(VERSION),'2.44.0')
PLATFORM := $(shell uname -s)
all: hub chrome firefox chromedebug firefoxdebug
build: all
ci: build test
base:
cd ./Base && docker build -t $(NAME)/base:$(VERSION) .
hub: base
cd ./Hub && docker build -t $(NAME)/hub:$(VERSION) .
nodebase: base
cd ./NodeBase && docker build -t $(NAME)/node-base:$(VERSION) .
chrome: nodebase
cd ./NodeChrome && docker build -t $(NAME)/node-chrome:$(VERSION) .
firefox: nodebase
cd ./NodeFirefox && docker build -t $(NAME)/node-firefox:$(VERSION) .
generate_chromedebug:
cd ./NodeDebug && ./generate.sh NodeChromeDebug node-chrome Chrome $(VERSION)
chromedebug: generate_chromedebug chrome
cd ./NodeChromeDebug && docker build -t $(NAME)/node-chrome-debug:$(VERSION) .
generate_firefoxdebug:
cd ./NodeDebug && ./generate.sh NodeFirefoxDebug node-firefox Firefox $(VERSION)
firefoxdebug: generate_firefoxdebug firefox
cd ./NodeFirefoxDebug && docker build -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
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
docker push $(NAME)/base
docker push $(NAME)/hub
docker push $(NAME)/node-base
docker push $(NAME)/node-chrome
docker push $(NAME)/node-firefox
@echo "*** Don't forget to create a tag. git tag rel-$(VERSION) && git push origin rel-$(VERSION)"
test:
./test.sh
./test.sh debug
.PHONY: all build ci base hub nodebase chrome firefox \
generate_chromedebug chromedebug generate_firefoxdebug firefoxdebug \
tag_latest release test