· 9 years ago · Jun 24, 2016, 12:33 AM
1#!/bin/bash
2
3# This first script will run all of the root commands necessary to install taiga,
4# then will call another script to be run as user taiga to complete installation.
5
6# Create user taiga and homedir
7useradd -m taiga
8
9# Install all deps from install guide
10apt-get install -y build-essential binutils-doc autoconf flex bison libjpeg-dev \
11libfreetype6-dev zlib1g-dev libzmq3-dev libgdbm-dev libncurses5-dev \
12automake libtool libffi-dev curl git tmux gettext \
13postgresql-9.5 postgresql-contrib-9.5 postgresql-doc-9.5 postgresql-server-dev-9.5 \
14python3 python3-pip python-dev python3-dev python-pip virtualenvwrapper \
15libxml2-dev libxslt-dev rabbitmq-server redis-server nodejs nodejs-legacy npm
16
17# Create postgres user and database
18sudo -u postgres createuser taiga
19sudo -u postgres createdb taiga -O taiga
20
21# Creates taigaBuild script
22echo '
23#!/bin/bash -l
24
25cd /home/taiga
26git clone https://github.com/taigaio/taiga-back.git taiga-back
27cd /home/taiga/taiga-back
28git checkout stable
29
30mkvirtualenv -p /usr/bin/python3.5 taiga
31pip install -r requirements.txt
32
33python manage.py migrate --noinput
34python manage.py loaddata initial_user
35python manage.py loaddata initial_project_templates
36python manage.py loaddata initial_role
37python manage.py compilemessages
38python manage.py collectstatic --noinput
39
40echo '\''
41
42
43from .common import *
44
45MEDIA_URL = "http://example.com/media/"
46STATIC_URL = "http://example.com/static/"
47ADMIN_MEDIA_PREFIX = "http://example.com/static/admin/"
48SITES["front"]["scheme"] = "http"
49SITES["front"]["domain"] = "example.com"
50
51SECRET_KEY = "theveryultratopsecretkey"
52
53DEBUG = False
54TEMPLATE_DEBUG = False
55PUBLIC_REGISTER_ENABLED = True
56
57DEFAULT_FROM_EMAIL = "no-reply@example.com"
58SERVER_EMAIL = DEFAULT_FROM_EMAIL
59
60# Uncomment and populate with proper connection parameters
61# for enable email sending. EMAIL_HOST_USER should end by @domain.tld
62#EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
63#EMAIL_USE_TLS = False
64#EMAIL_HOST = "localhost"
65#EMAIL_HOST_USER = ""
66#EMAIL_HOST_PASSWORD = ""
67#EMAIL_PORT = 25
68
69# Uncomment and populate with proper connection parameters
70# for enable github login/singin.
71#GITHUB_API_CLIENT_ID = "yourgithubclientid"
72#GITHUB_API_CLIENT_SECRET = "yourgithubclientsecret"
73
74
75'\'' >> /home/taiga/taiga-back/settings/local.py
76
77' > /home/taiga/taigaBuild.sh
78
79chmod +x /home/taiga/taigaBuild.sh
80chown taiga /home/taiga/taigaBuild.sh
81sudo -u taiga /home/taiga/taigaBuild.sh