1 | #!/usr/bin/env bash
|
2 |
|
3 |
|
4 |
|
5 | ydbver="r128"
|
6 | ydbversion=r1.28
|
7 |
|
8 |
|
9 |
|
10 | echo 'Preparing environment'
|
11 |
|
12 | sudo apt-get update
|
13 | sudo apt-get install -y build-essential libssl-dev dos2unix nano locate subversion
|
14 | sudo apt-get install -y wget gzip openssh-server curl python-minimal libelf1
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | echo 'Installing YottaDB'
|
20 |
|
21 | echo "Installing YottaDB $ydbversion"
|
22 |
|
23 |
|
24 | mkdir -p /tmp/tmp
|
25 | cd /tmp/tmp
|
26 | wget https://gitlab.com/YottaDB/DB/YDB/raw/master/sr_unix/ydbinstall.sh
|
27 | chmod +x ydbinstall.sh
|
28 |
|
29 | gtmroot=/usr/lib/yottadb
|
30 | gtmcurrent=$gtmroot/current
|
31 |
|
32 |
|
33 | sudo mkdir -p $gtmcurrent
|
34 | sudo ./ydbinstall.sh --utf8 default --verbose --linkenv $gtmcurrent --linkexec $gtmcurrent --force-install $ydbversion
|
35 | echo "Configuring YottaDB $ydbversion"
|
36 |
|
37 | gtmprof=$gtmcurrent/gtmprofile
|
38 | gtmprofcmd="source $gtmprof"
|
39 | $gtmprofcmd
|
40 | tmpfile=`mktemp`
|
41 |
|
42 | echo 'copying ' $gtmprofcmd ' to profile...'
|
43 | echo $gtmprofcmd >> ~/.profile
|
44 |
|
45 | rm $tmpfile
|
46 | unset tmpfile gtmprofcmd gtmprof gtmcurrent gtmroot
|
47 |
|
48 | mkdir ~/.yottadb/sessiondb
|
49 |
|
50 | cat >~/.yottadb/sessiondb/gde.txt <<EOL
|
51 | add -name qs -region=qewdreg
|
52 | add -region qewdreg -dynamic=qewdseg
|
53 | add -segment qewdseg -file=$HOME/.yottadb/sessiondb/qewd.dat
|
54 | exit
|
55 | EOL
|
56 |
|
57 | echo 'Setting up local internal, unjournalled region for QEWD Session global'
|
58 | /usr/local/lib/yottadb/$ydbver/mumps -run ^GDE < $HOME/.yottadb/sessiondb/gde.txt
|
59 | /usr/local/lib/yottadb/$ydbver/mupip create -region=qewdreg
|
60 | /usr/local/lib/yottadb/$ydbver/mupip set -file -nojournal $HOME/.yottadb/sessiondb/qewd.dat
|
61 |
|
62 | echo 'YottaDB has been installed and configured, ready for use'
|
63 |
|
64 |
|
65 |
|
66 | echo 'Installing Node.js'
|
67 |
|
68 | cd ~
|
69 |
|
70 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.2/install.sh | bash
|
71 | export NVM_DIR="$HOME/.nvm"
|
72 | [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
73 |
|
74 | VERSION=${1:-12}
|
75 |
|
76 | nvm install $VERSION
|
77 |
|
78 | PLATFORM=$(uname -m)
|
79 | if [[ "$PLATFORM" != "armv"* ]]; then
|
80 |
|
81 |
|
82 |
|
83 | sudo ln -s /usr/local/bin/node /usr/bin/node
|
84 | sudo ln -s /usr/local/lib/node /usr/lib/node
|
85 | sudo ln -s /usr/local/bin/npm /usr/bin/npm
|
86 | sudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf
|
87 | n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local
|
88 | fi
|
89 |
|
90 |
|