]> Git — Sourcephile - gargantext.git/blob - devops/debian/install
[ADMIN] dependences.
[gargantext.git] / devops / debian / install
1 #!/bin/bash
2
3 sudo apt update
4 sudo apt upgrade
5
6 sudo sed -i "s/stretch/buster/g" /etc/apt/sources.list
7
8 sudo apt update
9 sudo apt dist-upgrade
10
11 sudo adduser --disabled-password --gecos "" gargantua
12
13 if git --version;
14 then
15 echo "git installed, ok"
16 else
17 sudo apt update && sudo apt install git
18 git config --global user.email "contact@gargantext.org"
19 git config --global user.name "Gargantua"
20 fi
21
22 sudo apt update
23 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
24
25 #echo "Which user?"
26 #read USER
27 #sudo adduser --disabled-password --gecos "" $USER
28 #sudo su $USER
29
30 curl -sSL https://get.haskellstack.org/ | sh
31 stack update
32 stack upgrade
33
34 git clone https://gitlab.iscpif.fr/gargantext/haskell-gargantext.git
35
36
37 cd haskell-gargantext
38 git clone https://gitlab.iscpif.fr/gargantext/purescript-gargantext
39
40 ##########
41 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
42 echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
43 sudo apt update
44 sudo apt install yarn
45
46 mkdir deps
47 cd deps
48 git clone https://gitlab.iscpif.fr/gargantext/clustering-louvain.git
49 cd ..
50
51 stack setup
52 stack build
53 stack install
54
55
56 # Specific to our servers
57
58 ### Configure timezone and locale ###################################
59 echo "########### LOCALES & TZ #################"
60 echo "Europe/Paris" > /etc/timezone
61 dpkg-reconfigure --frontend=noninteractive tzdata
62 #ENV TZ "Europe/Paris"
63
64 sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
65 sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
66 locale-gen && \
67 update-locale LANG=fr_FR.UTF-8 && \
68 update-locale LANGUAGE=fr_FR.UTF-8 && \
69 update-locale LC_ALL=fr_FR.UTF-8
70 ################################################################
71
72 # Database configuration
73 # CREATE USER gargantua WITH PASSWORD $(grep DB_PASS gargantext.ini)
74 # GRANT ALL PRIVILEGES ON DATABASE gargandbV4 to gargantua
75
76 #######################################################################
77 ## POSTGRESQL DATA (as ROOT)
78 #######################################################################
79
80 PGVersion = 11
81 mkdir /srv/gargantua/gargandata
82
83 sed -iP "s%^data_directory.*%data_directory = \'\/srv\/gargantua\/gargandata\'%" /etc/postgresql/$PGVersion/main/postgresql.conf
84 #echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/$PGVersion/main/pg_hba.conf
85 #echo "listen_addresses='*'" >> /etc/postgresql/$PGVersion/main/postgresql.conf
86