]> Git — Sourcephile - gargantext.git/blob - devops/debian-install
[TODO] remove title in FacetDoc.
[gargantext.git] / devops / debian-install
1 #!/bin/bash
2
3
4
5 if git --version;
6 then
7 echo "git installed, ok"
8 else
9 sudo apt update && sudo apt install git
10 fi
11
12 sudo apt update
13 sudo apt install liblzma-dev libpcre3-dev libblas-dev liblapack-dev pkg-config libgsl-dev libbz2-dev postgresql postgresql-server-dev-9.6 nginx libigraph-dev
14
15 #echo "Which user?"
16 #read USER
17 #sudo adduser --disabled-password --gecos "" $USER
18 #sudo su $USER
19
20 curl -sSL https://get.haskellstack.org/ | sh
21 stack update
22 stack upgrade
23
24
25 git clone https://gitlab.iscpif.fr/gargantext/haskell-gargantext.git
26
27 cd haskell-gargantext
28 git clone https://gitlab.iscpif.fr/gargantext/purescript-gargantext
29
30 mkdir deps
31 cd deps
32 git clone https://gitlab.iscpif.fr/gargantext/clustering-louvain.git
33 git clone https://github.com/np/servant-job.git
34 git clone https://github.com/np/patches-map
35 git clone https://gitlab.com/npouillard/patches-class.git
36 git clone https://github.com/delanoe/haskell-opaleye
37 git clone -b next --single-branch https://github.com/delanoe/hsparql
38 cd ..
39
40 stack setup
41 stack build
42 stack install
43
44
45 # Specific to our servers
46
47 ### Configure timezone and locale ###################################
48 echo "########### LOCALES & TZ #################"
49 echo "Europe/Paris" > /etc/timezone
50 dpkg-reconfigure --frontend=noninteractive tzdata
51 #ENV TZ "Europe/Paris"
52
53 sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
54 sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
55 locale-gen && \
56 update-locale LANG=fr_FR.UTF-8 && \
57 update-locale LANGUAGE=fr_FR.UTF-8 && \
58 update-locale LC_ALL=fr_FR.UTF-8
59 ################################################################
60
61 # Database configuration
62 # CREATE USER gargantua WITH PASSWORD $(grep DB_PASS gargantext.ini)
63 # GRANT ALL PRIVILEGES ON DATABASE gargandbV4 to gargantua
64
65 #######################################################################
66 ## POSTGRESQL DATA (as ROOT)
67 #######################################################################
68 sed -iP "s%^data_directory.*%data_directory = \'\/srv\/gargandata\'%" /etc/postgresql/9.6/main/postgresql.conf
69 echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.6/main/pg_hba.conf
70 echo "listen_addresses='*'" >> /etc/postgresql/9.6/main/postgresql.conf
71