diff options
author | Ian Coleman <ian@iancoleman.io> | 2020-10-01 23:53:06 +0000 |
---|---|---|
committer | Ian Coleman <ian@iancoleman.io> | 2020-10-01 23:55:21 +0000 |
commit | 8dbf7d5837949c56c3c2824cd5382068e439af17 (patch) | |
tree | 9a64de4b993da8d5784bfac693c1f907622104dd | |
parent | bf96267f89d18f278e78cf02c97ab1e7513fb871 (diff) | |
download | BIP39-8dbf7d5837949c56c3c2824cd5382068e439af17.tar.gz BIP39-8dbf7d5837949c56c3c2824cd5382068e439af17.tar.zst BIP39-8dbf7d5837949c56c3c2824cd5382068e439af17.zip |
Add dev_env_setup.sh
-rwxr-xr-x | dev_env_setup.sh | 58 |
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 | |||
5 | echo "This script is intended to be run in a VM." | ||
6 | echo "It may do things to your OS that you don't want to be peristent." | ||
7 | echo "Please type virtualmachine to continue, or Ctrl-C to quit." | ||
8 | |||
9 | read passage | ||
10 | |||
11 | if [ "$passage" = "virtualmachine" ]; then | ||
12 | echo "Installing dev environment" | ||
13 | else | ||
14 | echo "Did not type virtualmachine, quitting with no changes applied" | ||
15 | exit | ||
16 | fi | ||
17 | |||
18 | # set up place for local binaries | ||
19 | mkdir $HOME/.bin | ||
20 | echo "export PATH=$PATH:$HOME/.bin" >> $HOME/.bashrc | ||
21 | source $HOME/.bashrc | ||
22 | |||
23 | # allow python3 to be run with python command | ||
24 | ln -s /usr/bin/python3 $HOME/.bin/python | ||
25 | |||
26 | # install firefox and other dependencies | ||
27 | sudo apt-get -y install firefox unzip openjdk-11-jre-headless xvfb libxi6 libgconf-2-4 | ||
28 | # install chrome | ||
29 | curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add | ||
30 | sudo sh -c "echo \"deb https://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google-chrome.list" | ||
31 | sudo apt-get -y update | ||
32 | sudo apt-get -y install google-chrome-stable | ||
33 | |||
34 | # install nodejs for running tests | ||
35 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash | ||
36 | # load nvm | ||
37 | source $HOME/.bashrc | ||
38 | export 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 | ||
42 | nvm install node | ||
43 | # install jasmine | ||
44 | cd tests | ||
45 | npm install --global jasmine | ||
46 | npm install selenium-webdriver | ||
47 | # install gecko webdriver for firefox | ||
48 | wget https://github.com/mozilla/geckodriver/releases/download/v0.27.0/geckodriver-v0.27.0-linux64.tar.gz --output-document=/tmp/geckodriver.tar.gz | ||
49 | tar -xf /tmp/geckodriver.tar.gz -C $HOME/.bin | ||
50 | # install chrome webdriver for chromium | ||
51 | wget https://chromedriver.storage.googleapis.com/85.0.4183.87/chromedriver_linux64.zip --output-document=/tmp/chromedriver.zip | ||
52 | unzip /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 | ||