forked from ycm-core/ycmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvagrant_bootstrap.sh
131 lines (99 loc) · 3.55 KB
/
vagrant_bootstrap.sh
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/env bash
#
# Don't forget, this file needs to be idempotent, i.e. running it multiple times
# in a row leaves the system in the same state as if it were run only once.
#######################
# ENV VAR SETUP
#######################
# Makes apt-get STFU about pointless nonsense
export DEBIAN_FRONTEND=noninteractive
# For pyenv Python building
export CFLAGS='-O2'
#######################
# APT-GET INSTALL
#######################
apt-get update
apt-get -yqq dist-upgrade
apt-get install -yqq python-dev
apt-get install -yqq python-setuptools
apt-get install -yqq python3
apt-get install -yqq python3-dev
apt-get install -yqq python3-setuptools
apt-get install -yqq build-essential
apt-get install -yqq ninja-build
apt-get install -yqq cmake
apt-get install -yqq git
apt-get install -yqq golang
apt-get install -yqq mono-complete
# These two are for pyopenssl
apt-get install -yqq libffi-dev
apt-get install -yqq libssl-dev
# These are Python build deps (though it depends on Python version). We need
# them because pyenv builds Python.
apt-get install -yqq libssl-dev
apt-get install -yqq zlib1g-dev
apt-get install -yqq libbz2-dev
apt-get install -yqq libreadline-dev
apt-get install -yqq libsqlite3-dev
apt-get install -yqq wget
apt-get install -yqq curl
apt-get install -yqq llvm
apt-get install -yqq libncurses5-dev
apt-get install -yqq libncursesw5-dev
#######################
# PIP SETUP
#######################
curl -sOL https://bootstrap.pypa.io/get-pip.py
python get-pip.py
#######################
# PYTHON LIBS
#######################
# This is needed to prevent InsecurePlatformWarning from showing up AFTER this
# stuff is installed.
pip install --upgrade pyopenssl ndg-httpsclient pyasn1
pip install -r /vagrant/test_requirements.txt
pip install coveralls
#######################
# NODEJS SETUP & LIBS
#######################
apt-get install -yqq nodejs
# Needed so that the node binary is named 'node' and not 'nodejs'; necessary
# because of scripts that call 'node'.
apt-get install -yqq nodejs-legacy
apt-get install -yqq npm
npm install -g typescript
#######################
# RUST SETUP
#######################
# multirust installation
echo "Installing multirust"
curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh \
| sh -s -- --yes >/dev/null 2>&1
# Needs to run as vagrant user otherwise it only sets up a Rust toolchain for
# root, which doesn't do us any good.
su - vagrant -c "multirust default stable 2>/dev/null"
#######################
# PYENV SETUP
#######################
git clone https://github.com/yyuu/pyenv.git /home/vagrant/.pyenv
chown -R vagrant:vagrant /home/vagrant/.pyenv
# Sourcing .profile to determine has provisioning already been done. If it has,
# then we don't re-add setup code.
source /home/vagrant/.profile
if [ -z "$PROVISIONING_DONE" ]; then
echo 'export PROVISIONING_DONE=true' >> /home/vagrant/.profile
echo 'export PYENV_ROOT="/home/vagrant/.pyenv"' >> /home/vagrant/.profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> /home/vagrant/.profile
echo 'eval "$(pyenv init -)"' >> /home/vagrant/.profile
echo 'cd /vagrant' >> /home/vagrant/.profile
# In case we just created the file.
chown vagrant:vagrant /home/vagrant/.profile
# We need the newly-added commands from .profile in the current shell to run
# pyenv.
source /home/vagrant/.profile
pyenv install 2.6.6
pyenv install 3.3.0
# Avoid relying on the system python at all. Devs using some other
# python is perfectly fine, but let's use a supported version by default.
echo 'pyenv global 2.6.6' >> /home/vagrant/.profile
fi