|
|
# Calculate path=/var/calculate/bin name=#-cut(1,.)-# chmod=755 comment=#
|
|
|
#!/bin/bash
|
|
|
|
|
|
set -eo pipefail
|
|
|
export PATH="/lib/rc/bin:$PATH"
|
|
|
|
|
|
if [[ $UID == 0 ]]
|
|
|
then
|
|
|
exec su - taiga -c /var/calculate/bin/install-taiga
|
|
|
fi
|
|
|
|
|
|
source /var/calculate/config/taiga
|
|
|
|
|
|
if [[ ! -e ~/.node-live ]]
|
|
|
then
|
|
|
einfo Установка Node.js
|
|
|
cd ~
|
|
|
nodeenv --node=$NODE .node-${NODE%%.*}
|
|
|
ln -sfT .node-${NODE%%.*} .node-live
|
|
|
fi
|
|
|
source ~/.node-live/bin/activate
|
|
|
|
|
|
set -u
|
|
|
|
|
|
install_taiga_back(){
|
|
|
cd ~
|
|
|
einfo 'Получение кода taiga_back'
|
|
|
git clone https://github.com/kaleidos-ventures/taiga-back.git taiga-back
|
|
|
cd taiga-back
|
|
|
git checkout stable
|
|
|
|
|
|
einfo 'Создание виртуальной среды'
|
|
|
python -m venv .venv --prompt taiga-back
|
|
|
source .venv/bin/activate
|
|
|
pip install --upgrade pip wheel
|
|
|
|
|
|
einfo 'Установка всех зависимостей Python'
|
|
|
pip install -r requirements.txt
|
|
|
|
|
|
einfo 'Установка taiga-contrib-protected'
|
|
|
pip install git+https://github.com/kaleidos-ventures/taiga-contrib-protected.git@stable#egg=taiga-contrib-protected
|
|
|
|
|
|
ebegin 'Копирование фала настроек'
|
|
|
cp settings/config.py.prod.example settings/config.py
|
|
|
eend
|
|
|
}
|
|
|
|
|
|
install_taiga_front_dist(){
|
|
|
cd ~
|
|
|
einfo 'Получeние кода taiga_front_dist'
|
|
|
git clone https://github.com/kaleidos-ventures/taiga-front-dist.git taiga-front-dist
|
|
|
cd taiga-front-dist
|
|
|
git checkout stable
|
|
|
|
|
|
ebegin 'Копирование примера файла конфигурации'
|
|
|
cp ~/taiga-front-dist/dist/conf.example.json ~/taiga-front-dist/dist/conf.json
|
|
|
eend
|
|
|
}
|
|
|
|
|
|
install_taiga_events(){
|
|
|
cd ~
|
|
|
einfo 'Получение кода taiga_events'
|
|
|
git clone https://github.com/kaleidos-ventures/taiga-events.git taiga-events
|
|
|
cd taiga-events
|
|
|
git checkout stable
|
|
|
|
|
|
einfo 'Установка необходимых зависимостей JavaScript'
|
|
|
#source ~/.node-live/bin/activate
|
|
|
npm install
|
|
|
npm audit fix
|
|
|
|
|
|
ebegin 'Создание .env файла на основе предоставленного примера'
|
|
|
cp .env.example .env
|
|
|
eend
|
|
|
}
|
|
|
|
|
|
install_taiga_protected(){
|
|
|
cd ~
|
|
|
einfo 'Получение кода taiga_protected'
|
|
|
git clone https://github.com/kaleidos-ventures/taiga-protected.git taiga-protected
|
|
|
cd taiga-protected
|
|
|
git checkout stable
|
|
|
|
|
|
einfo 'Создание виртуальной среды'
|
|
|
python -m venv .venv --prompt taiga-protected
|
|
|
source .venv/bin/activate
|
|
|
pip install --upgrade pip wheel
|
|
|
|
|
|
einfo 'Установка всех зависимостей Python'
|
|
|
pip install -r requirements.txt
|
|
|
|
|
|
ebegin 'Копирование примера файла конфигурации'
|
|
|
cp ~/taiga-protected/env.sample ~/taiga-protected/.env
|
|
|
eend
|
|
|
}
|
|
|
|
|
|
migrate_pgsql(){
|
|
|
cd ~
|
|
|
cd taiga-back
|
|
|
source .venv/bin/activate
|
|
|
DJANGO_SETTINGS_MODULE=settings.config python manage.py migrate --noinput
|
|
|
einfo create an administrator with strong password
|
|
|
CELERY_ENABLED=False DJANGO_SETTINGS_MODULE=settings.config python manage.py createsuperuser
|
|
|
DJANGO_SETTINGS_MODULE=settings.config python manage.py loaddata initial_project_templates
|
|
|
DJANGO_SETTINGS_MODULE=settings.config python manage.py compilemessages
|
|
|
DJANGO_SETTINGS_MODULE=settings.config python manage.py collectstatic --noinput
|
|
|
}
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
# Запуск
|
|
|
#-----------------------------------------------------------------------------
|
|
|
[[ ! -e ~/taiga-back ]] && install_taiga_back
|
|
|
|
|
|
[[ ! -e ~/taiga-front-dist ]] && install_taiga_front_dist
|
|
|
|
|
|
[[ ! -e ~/taiga-events ]] && install_taiga_events
|
|
|
|
|
|
[[ ! -e ~/taiga-protected ]] && install_taiga_protected
|
|
|
|
|
|
einfo "Все установлено! Для настройки Taiga выполните 'setup-taiga'."
|
|
|
|
|
|
#migrate_pgsql
|
|
|
|