-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
37 lines (34 loc) · 1.17 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
PATH := "$(NVM_BIN):$(PATH)"
UID := $(shell id -u)
NVM_BINARY := $(shell which node)
.PHONY: install-deps
install-deps:
which npm
which npx
chmod +x ~/.nvm/nvm.sh
cd .. && npm i
cd .. && npm i playwright@latest
cd .. && npx playwright install-deps
cd .. && ./generate_api_json.sh
cd .. && ./generate_perl_modules.pl
.PHONY: install-service
install-service:
test $(PORT)
test $(NVM_BINARY)
make install-deps
[ ! -f /etc/redhat-release ] || make enable-systemd-user-mode
mkdir -p ~/.config/systemd/user
cp playwright.unit ~/.config/systemd/user/playwright.service
sed -i 's#__REPLACEME__#$(shell pwd)#g' ~/.config/systemd/user/playwright.service
sed -i 's#__PORT__#$(PORT)#g' ~/.config/systemd/user/playwright.service
sed -i 's#!/usr/bin/node#!$(NVM_BINARY)#g' ../bin/playwright_server
systemctl --user daemon-reload
systemctl --user enable playwright
systemctl --user start playwright
sudo loginctl enable-linger $(USER)
.PHONY: enable-systemd-user-mode
enable-systemd-user-mode:
sudo cp systemd/centos-user-mode.unit /etc/systemd/system/user@$(UID).service
sudo systemctl daemon-reload
sudo systemctl enable user@$(UID).service
sudo systemctl start user@$(UID).service