-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall_on_server.bash
executable file
·86 lines (68 loc) · 1.61 KB
/
install_on_server.bash
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
#!/bin/bash
set -e
CWD=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "$CWD"
NVM_VERSION="v0.39.7"
if [[ -z "${NODE_VERSION}" ]]; then
NODE_VERSION=20
fi
set -u
##
## Base dependencies
##
sudo apt-get update
sudo apt-get install -y \
git \
gcc \
pkg-config \
jq `# Used for graph generation` \
libfreetype6-dev libfontconfig1-dev `# Used by Rust Plotters crate` \
##
## Rust
##
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
##
## Processtime is used to calculate build duration
##
cargo install processtime
##
## NVM & Node
##
curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh" | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[[ -f "${HOME}/.bashrc" ]] && source "${HOME}/.bashrc" && echo "Sourced .bashrc"
nvm install 20
node -v
# Package managers
npm i -g npm yarn pnpm
# Install http server for runtime tests
npx http-server --help
##
## Systemd service installation
##
CONTENT=$(cat <<EOF
[Unit]
Description=Benchmark frontend frameworks
[Service]
Type=simple
User=${USER}
Restart=always
RestartSec=3
WorkingDirectory=${CWD}
ExecStart=/bin/bash --login ${CWD}/bench_it_all.bash server
[Install]
WantedBy=multi-user.target
EOF
)
echo "${CONTENT}" | sudo tee /etc/systemd/system/benchmark-frontend-frameworks.service
sudo systemctl daemon-reload
sudo systemctl start benchmark-frontend-frameworks.service
##
## Playwright and browsers
##
yarn install
yarn playwright install-deps # Install browser dependencies, might use sudo
yarn playwright install # Install browsers themselves
##
echo "Done!"