forked from TwilioDevEd/api-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_travis_dependencies.sh
executable file
·36 lines (30 loc) · 1.12 KB
/
install_travis_dependencies.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
#!/bin/bash
languages=""
if [ -n "$SNIPPET_LANGUAGE" ]; then
echo "Installing dependencies for: ${SNIPPET_LANGUAGE//:/,}"
languages="$SNIPPET_LANGUAGE"
fi
# Install common dependencies
sudo apt-get install -y --force-yes build-essential ca-certificates git curl
sudo add-apt-repository ppa:cwchien/gradle -y
sudo apt-get update
sudo apt-get install -y --force-yes gradle
if [[ $languages == *"python"* ]]; then
sudo apt-get install -y --force-yes python-dev python-pip
sudo pip install --upgrade pip wheel virtualenv virtualenvwrapper --quiet
sudo pip install -r requirements.txt
fi
if [[ $languages == *"php"* ]]; then
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get install -y --force-yes php5.6
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
fi
if [[ $languages == *"node"* ]]; then
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
nvm install --lts
npm install
fi