install 3.54 KB
Newer Older
1 2
#!/bin/bash

3 4 5 6 7 8 9 10 11 12 13 14 15
#   ____                             _            _   
#  / ___| __ _ _ __ __ _  __ _ _ __ | |_ _____  _| |_ 
# | |  _ / _` | '__/ _` |/ _` | '_ \| __/ _ \ \/ / __|
# | |_| | (_| | | | (_| | (_| | | | | ||  __/>  <| |_ 
#  \____|\__,_|_|  \__, |\__,_|_| |_|\__\___/_/\_\\__|
#                  |___/                              

# This receipe is for specific use (Open Stack && Debien)
# Step by step installation process (advanced user mainly)
# For others: a docker image is coming

########################################################################
# To be sure to have updated packages
16 17 18
sudo apt update
sudo apt upgrade

19 20 21
# Tmux to avoid disconnections during the installation process
# Htop for visual monitoring
sudo apt install tmux htop
22

23
########################################################################
24
sudo sed -i "s/stretch/buster/g" /etc/apt/sources.list
25
sudo apt update
26
sudo apt dist-upgrade
27 28
# sudo reboot #recommended
########################################################################
29

30
#sudo apt update
Alexandre Delanoë's avatar
Alexandre Delanoë committed
31
sudo apt install liblzma-dev libpcre3-dev libblas-dev liblapack-dev pkg-config libgsl-dev libbz2-dev postgresql postgresql-server-dev-11 nginx libigraph0-dev libgfortran-9-dev
32

33
sudo apt install git
34 35
#git config --global user.email "contact@gargantext.org"
#git config --global user.name "Gargantua"
36 37 38


########################################################################
39
echo "Which user?"
40
#read USER
41
USER="gargantua"
42
sudo adduser --disabled-password --gecos "" $USER
43

44 45 46 47
########################################################################
#cd /home
#sudo mv -if /home/$USER /srv/
#sudo ln -s /srv/$USER
48

49
curl -sSL https://get.haskellstack.org/ | sh
50

51
sudo apt install curl
52
sudo su $USER
53
stack update
54
stack upgrade
55

56
#git clone https://gitlab.iscpif.fr/gargantext/haskell-gargantext.git
57

58
#cd haskell-gargantext
59
##########
60

61 62 63
if [[ ! -d "purescript-gargantext" ]]; then
  ./devops/debian/install-purescript
fi
64 65 66 67 68

#########################################################################

# stack install should be enough but all process is the following steps
stack setup && stack build && stack install
69

70 71 72 73
#########################################################################
# build deps


74 75 76
if [[ ! -d "deps" ]]; then
  mkdir -v deps
  cd deps
77

78 79 80 81 82 83 84 85 86
  sudo apt install default-jdk
  if [[ ! -f "coreNLP.tar.bz2" ]]; then
    wget https://dl.gargantext.org/coreNLP.tar.bz2
  fi
  if [[ ! -d "home" ]]; then
    tar xvjf coreNLP.tar.bz2
  fi
  # CoreNLP needs to be started
  # ./startServer.sh
87

88 89
  cd ..
fi
90

91

92
# Specific to our servers
93

94 95 96 97 98 99 100 101 102 103 104 105 106 107
#### Configure timezone and locale ###################################
# todo sync dates
#echo "###########  LOCALES & TZ #################"
#echo "Europe/Paris" > /etc/timezone
#dpkg-reconfigure --frontend=noninteractive tzdata
##ENV TZ "Europe/Paris"
#
#sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
#sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
#locale-gen && \
#update-locale LANG=fr_FR.UTF-8 && \
#update-locale LANGUAGE=fr_FR.UTF-8 && \
#update-locale LC_ALL=fr_FR.UTF-8
#################################################################
108

109 110 111
# Database configuration
# CREATE USER gargantua WITH PASSWORD $(grep DB_PASS gargantext.ini)
# GRANT ALL PRIVILEGES ON DATABASE gargandbV4 to gargantua
112 113 114 115

#######################################################################
## POSTGRESQL DATA (as ROOT)
#######################################################################
116

117
./devops/debian/install-postgres
118 119 120

# configure the database with script in devops/postgres
# edit gargantext.ini
121