forked from pagopa-archive/io-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
78 lines (67 loc) · 2.39 KB
/
setup.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
#!/bin/bash
set -e
export NODENV_VERSION=12.18.0
export PYENV_VERSION=3.7.7
export GOENV_VERSION=1.13.12
export LOCAL="$HOME/.local"
export BIN="$LOCAL/bin"
mkdir -p "$BIN"
case "$(uname)" in
(Darwin)
brew install readline xz zip unzip
WSK_INSTALL=https://github.com/apache/openwhisk-cli/releases/download/1.0.0/OpenWhisk_CLI-1.0.0-mac-amd64.zip
JQ_INSTALL=https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64
curl -sL $WSK_INSTALL >$BIN/wsk.zip
unzip -o $BIN/wsk.zip wsk -d $BIN
;;
(Linux)
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl libncurses5-dev libncursesw5-dev \
xz-utils libffi-dev liblzma-dev python-openssl git zip
WSK_INSTALL=https://github.com/apache/openwhisk-cli/releases/download/1.0.0/OpenWhisk_CLI-1.0.0-linux-amd64.tgz
JQ_INSTALL=https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
curl -sL $WSK_INSTALL >$BIN/wsk.tgz
tar xzvf $BIN/wsk.tgz -C $BIN wsk
;;
(*)
echo unsupported operating system
exit 1
;;
esac
curl -sL $JQ_INSTALL >$BIN/jq
chmod +x $BIN/jq $BIN/wsk
mkdir -p $BIN
# install
export PYENV_ROOT="$HOME/.pyenv"
export NODENV_ROOT="$HOME/.nodenv"
export GOENV_ROOT="$HOME/.goenv"
if ! test -d $GOENV_ROOT
then git clone https://github.com/syndbg/goenv.git $GOENV_ROOT
fi
if ! test -e $NODENV_ROOT
then git clone https://github.com/nodenv/nodenv.git $NODENV_ROOT
mkdir "$NODENV_ROOT/plugins"
git clone https://github.com/nodenv/node-build.git "$NODENV_ROOT"/plugins/node-build
fi
if ! test -e $PYENV_ROOT
then git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT
fi
if ! test -e $LOCAL/bats
then git clone https://github.com/sstephenson/bats.git $LOCAL/bats
"$LOCAL/bats/install.sh" $LOCAL
fi
export PATH="$HOME/.local/bin:$GOENV_ROOT/bin:$NODENV_ROOT/bin:$PYENV_ROOT/bin:$PATH"
eval "$(nodenv init -)"
nodenv install $NODENV_VERSION -s
echo $NODENV_VERSION >.node-version
eval "$(pyenv init -)"
#eval "$(pyenv virtualenv-init -)"
pyenv install $PYENV_VERSION -s
echo $PYENV_VERSION >.python-version
eval "$(goenv init -)"
goenv install $GOENV_VERSION -s
echo $GOENV_VERSION >.go-version
# etc
python3 -mpip install redis==3.4.1 httpie==2.1.0
npm install -g https://apigcp.nimbella.io/downloads/nim/nimbella-cli.tgz