You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
container-overlay/profiles/templates/taiga/taiga/sh.install-taiga

144 lines
4.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 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
all=
while IFS= read -r line
do
if [[ $line == *"["* ]]
then
line=${line#*[}
line=${line%%]*}
sec=$line
continue
fi
if [[ ${line:0:1} == '#' || $line == '' ]]
then
continue
fi
com=${sec}_${line// =/=};
com=${com//= /=};
all="$com; $all"
done < /var/calculate/ini.env
eval $all
if [[ ! -e ~/.node-live ]]
then
einfo 'Установка Node.js'
cd ~
nodeenv --node=$taiga_node .node-${taiga_node%%.*}
ln -sfT .node-${taiga_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