-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_instance.sh
More file actions
85 lines (68 loc) · 2.67 KB
/
setup_instance.sh
File metadata and controls
85 lines (68 loc) · 2.67 KB
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
#!/bin/bash
# Debug(debug) mode setup: additionally installs python debug mode and valgrind
# over the normal Developer(dev) mode setup
# Python debug build is very slow and valgrid can introduce slowdowns upto 20x
# Hence do not setup Debug mode unless you need it !!
# Sync option installs unison on your machine for code sync
# you still need to configure it on your local PC for sync to work
## Types of setups possible with this script ##
# Developer mode w/o code sync run:
# $ bash setup_instance.sh dev
# Developer mode w/ code sync run:
# $ bash setup_instance.sh dev sync
# Debug mode w/o code sync run:
# $ bash setup_instance.sh debug
# Debug mode w/ code sync run:
# $ bash setup_instance.sh debug sync
##
## Author: access2rohit(srivastava.141@osu.edu)
##
set -eo pipefail
typeset -l $1
typeset -l $2
if [[ -z $1 ]]; then
echo "You must specify instance setup mode 'dev' or 'debug'"
return
elif [[ $1 == "debug" ]]; then
echo "Instance being setup in Debug mode"
else
echo "Instance being setup in Developer mode"
fi
sudo apt update
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
pip --no-cache-dir install pip --upgrade
mkdir -p ${HOME}/workspace
mkdir -p ${HOME}/temp
cd ${HOME}/temp
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/bashrc
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/gitconfig
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/screenrc
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/vimrc
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/install_vundle.sh
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/install_cmake.sh
cat bashrc >> ${HOME}/.bashrc
cat gitconfig >> ${HOME}/.gitconfig
cat screenrc >> ${HOME}/.screenrc
cat vimrc >> ${HOME}/.vimrc
# Install unison if setup needs code sync
if [[ $2 == "sync" ]]; then
echo "Installing unison for code sync"
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/install_ocaml_unison.sh
bash install_ocaml_unison.sh
fi
bash install_cmake.sh
##### install ALE linter and fixer #####
pip install mypy bandit pydocstyle black isort
bash install_vundle.sh
# Install debug tools if instance setup mode is "Debug"
typeset -l $1
if [[ $1 == "debug" ]]; then
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/install_python_debug.sh
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/install_valgrind.sh
bash install_python_debug.sh
bash install_valgrind.sh
fi
cd ${HOME}
sudo rm -rf ${HOME}/temp
echo "SUCCESS! Either 'source ~/.bashrc' or logout and login again for changes to take effect"