This repository has been archived by the owner on Jul 20, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
provision-debian.sh
executable file
·52 lines (39 loc) · 1.79 KB
/
provision-debian.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
#!/bin/bash
set -x # echo bash commands before execution, useful for debugging
set -e # stop bash execution on on first error
NODE_VERSION=8.1.4 # latest Node version as of 15-Aug-2017
JQ_VERSION=1.5 # latest jq version as of 15-Aug-2015
DOCKER_COMPOSE_VERSION=1.15.0
sudo apt-get update
sudo apt-get install -y \
python-pip \
git \
httpie \
gdal-bin \
unzip
# install ./jq (https://stedolan.github.io/jq/)
sudo wget -O /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64
sudo chmod a+x /usr/local/bin/jq
# nuke any previous versions of node in /usr/local/node
sudo rm -rf /usr/local/node-*-linux-x64 /usr/local/node
# donwnload and unpack node into /usr/local
cd /usr/local
wget -qO- https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz | sudo tar xvJ
sudo ln -s /usr/local/node-v${NODE_VERSION}-linux-x64 /usr/local/node
# install yarn
sudo env "PATH=/usr/local/node/bin/:${PATH}" npm install -g yarn@"0.27.5"
# add /usr/local/node to user vagrant's path
echo "export PATH=/usr/local/node/bin/:${PATH}" >> ${HOME}/.profile
# Install the node_packages using yarn (not npm)
cd /var/project-aclu/frontend
PATH=/usr/local/node/bin/:${PATH} yarn
# install the dockers
sudo apt-get remove docker docker.io 2>/dev/null
# used convenience scripts since this is just test
# https://docs.docker.com/engine/installation/linux/docker-ce/debian/#install-using-the-convenience-script
wget -qO- https://get.docker.com/ | sudo sh
# add user vagrant to the docker group to allow vagrant to run docker commands
sudo usermod -aG docker vagrant
# download docker-compose
sudo wget -O /usr/local/bin/docker-compose https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/run.sh
sudo chmod +x /usr/local/bin/docker-compose