added plugins
[fai-configs.git] / files / etc / init.d / install-mediagoblin / DEFAULT
... / ...
CommitLineData
1#/bin/bash
2echo Installing GMG into GMG_PATH_TOKEN...
3(
4cd GMG_PATH_TOKEN
5if [ ! -d mediagoblin ]; then
6
7 # Create the GMG user
8 sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1'"
9 sudo -u postgres psql -c "DROP DATABASE template1"
10 sudo -u postgres psql -c "CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING='UNICODE' LC_COLLATE='en_US.UTF8' LC_CTYPE='en_US.UTF8'"
11 sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'"
12 sudo -u postgres psql -c "UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template1'"
13
14 sudo -u postgres createuser -A -D mediagoblin
15 # Crea te GMG database
16 sudo -u postgres createdb -E UNICODE -O mediagoblin mediagoblin
17
18 sudo -u mediagoblin git clone git://git.savannah.gnu.org/mediagoblin.git -b stable
19
20 if [ ! -d mediagoblin-piwik ]; then
21 sudo -u mediagoblin git clone https://github.com/ayleph/mediagoblin-piwik
22 fi
23
24 if [ ! -d mediagoblin-libreplanet ]; then
25 sudo -u mediagoblin git clone https://vcs.fsf.org/git/mediagoblin-libreplanet.git
26 fi
27
28 cd mediagoblin
29 sudo -u mediagoblin git submodule init && git submodule update
30
31 sudo -u mediagoblin ./bootstrap.sh && sudo -u mediagoblin ./configure && sudo -u mediagoblin make
32 sudo -u mediagoblin mkdir user_dev && sudo -u mediagoblin chmod 750 user_dev
33 sudo -u mediagoblin ./bin/easy_install flup
34
35 sudo -u mediagoblin cp /etc/mediagoblin-templates/mediagoblin.ini mediagoblin_local.ini
36
37 sudo -u mediagoblin ./bin/gmg dbupdate
38
39 update-rc.d mediagoblin-paster defaults
40 update-rc.d mediagoblin-celery-worker defaults
41 /etc/init.d/mediagoblin-paster start
42 /etc/init.d/mediagoblin-celery-worker start
43fi
44) >> /var/log/fai/install-mediagoblin.log
45echo Install Completed, started mediagoblin-paster and mediagoblin-celery-worker