aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdev_env_setup.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/dev_env_setup.sh b/dev_env_setup.sh
new file mode 100755
index 0000000..68af109
--- /dev/null
+++ b/dev_env_setup.sh
@@ -0,0 +1,58 @@
1# this script is intended to be run in a VM
2# running ubuntu 20.04 server
3# from the root directory of this repo
4
5echo "This script is intended to be run in a VM."
6echo "It may do things to your OS that you don't want to be peristent."
7echo "Please type virtualmachine to continue, or Ctrl-C to quit."
8
9read passage
10
11if [ "$passage" = "virtualmachine" ]; then
12 echo "Installing dev environment"
13else
14 echo "Did not type virtualmachine, quitting with no changes applied"
15 exit
16fi
17
18# set up place for local binaries
19mkdir $HOME/.bin
20echo "export PATH=$PATH:$HOME/.bin" >> $HOME/.bashrc
21source $HOME/.bashrc
22
23# allow python3 to be run with python command
24ln -s /usr/bin/python3 $HOME/.bin/python
25
26# install firefox and other dependencies
27sudo apt-get -y install firefox unzip openjdk-11-jre-headless xvfb libxi6 libgconf-2-4
28# install chrome
29curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add
30sudo sh -c "echo \"deb https://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google-chrome.list"
31sudo apt-get -y update
32sudo apt-get -y install google-chrome-stable
33
34# install nodejs for running tests
35curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
36# load nvm
37source $HOME/.bashrc
38export NVM_DIR="$HOME/.nvm"
39[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
40[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
41# install latest node
42nvm install node
43# install jasmine
44cd tests
45npm install --global jasmine
46npm install selenium-webdriver
47# install gecko webdriver for firefox
48wget https://github.com/mozilla/geckodriver/releases/download/v0.27.0/geckodriver-v0.27.0-linux64.tar.gz --output-document=/tmp/geckodriver.tar.gz
49tar -xf /tmp/geckodriver.tar.gz -C $HOME/.bin
50# install chrome webdriver for chromium
51wget https://chromedriver.storage.googleapis.com/85.0.4183.87/chromedriver_linux64.zip --output-document=/tmp/chromedriver.zip
52unzip /tmp/chromedriver.zip -d $HOME/.bin
53
54# to run tests
55# cd tests
56# Xvfb :1 -screen 1 1024x768x24 & export DISPLAY=:1.1
57# BROWSER=firefox jasmine spec/tests.js
58# BROWSER=chrome jasmine spec/tests.js