oc-docker-tryton-non-official/trytond-modules_non_officia...

397 lines
11 KiB
Bash
Raw Permalink Normal View History

2022-01-05 21:59:15 +01:00
#!/usr/bin/bash
2023-05-15 18:41:52 +02:00
gitea_url="https://$GITEA_USER:$GITEA_PASSWORD@${GITEA_DOMAIN}/"
2022-01-05 21:59:15 +01:00
cd /tmp
2023-05-15 18:41:52 +02:00
git clone "${gitea_url}${REPO_MULTI_MIGRATE}"
2022-01-05 21:59:15 +01:00
multi_migrate="/tmp/oc-multi_migrate_to_gitea/migrate_to_gitea.py"
2023-05-15 18:41:52 +02:00
DIR_USR=/usr/local/lib/python
DIR_PACKAGES=/dist-packages/trytond/modules
DIR_MODULES="${DIR_USR}${PYTHON_VERSION}${DIR_PACKAGES}"
2022-09-05 20:48:16 +02:00
cd ${DIR_MODULES}
2023-05-15 18:41:52 +02:00
PYTHON_VERSION="python${PYTHON_VERSION}"
2022-11-15 06:00:06 +01:00
if [ "$WORKER" == "True" ]; then
cat <<EOF >>/etc/trytond.conf
[queue]
2022-11-22 06:03:05 +01:00
worker = True
EOF
fi
if [ "$SMTP" == "True" ]; then
cat <<EOF >>/etc/trytond.conf
[email]
uri = ${SMTP_TYPE}://${SMTP_USER}:${SMTP_PASSWORD}@${SMTP_DOMAIN}:${SMTP_PORT}
from = ${SMTP_FROM} <${SMTP_EMAIL}>
2022-11-15 06:00:06 +01:00
EOF
fi
2022-01-05 21:59:15 +01:00
clone_module() {
2022-09-05 20:48:16 +02:00
cd ${DIR_MODULES}
2022-01-05 21:59:15 +01:00
local org=$1
local branch=$2
local prefix=$3
shift
local Array=("${@}")
url=${gitea_url}${org}"/"
for module in "${Array[@]}"; do
if [ ${prefix} = 'False' ]; then
if [ ${branch} != "False" ]; then
if [ -d $module ]; then
echo "Module $module already exists"
else
git clone -b ${branch} $url$module
fi
fi
elif [ `echo $module | awk /${prefix}/` ]; then
name=`echo $modules$module | cut --complement -f 1 -d '-'`
if [ ${branch} != "False" ]; then
if [ -d $module ]; then
echo "Module $module already exists"
else
git clone -b ${branch} $url$module
mv $module $name
fi
else
git clone $url$module
cd $module
${PYTHON_VERSION} setup.py install
cd ..
fi
fi
done
}
2022-11-15 06:00:06 +01:00
2022-01-05 21:59:15 +01:00
inactive_module() {
2022-09-05 20:48:16 +02:00
cd ${DIR_MODULES}
2022-01-05 21:59:15 +01:00
local prefix=$1
local pip=$2
shift
local Array=("${@}")
for module in "${Array[@]}"; do
if [ $pip = "True" ]; then
pip uninstall -y $prefix$module
2022-01-12 16:20:19 +01:00
rm -rf $module
2022-01-05 21:59:15 +01:00
else
rm -rf $module
fi
done
}
2022-11-15 06:00:06 +01:00
if [ "$Provider" == "OneTeam" ]; then
2022-01-05 21:59:15 +01:00
apt-get update \
&& apt-get install -y --no-install-recommends \
git \
pkg-config \
libxml2-dev \
libxmlsec1-dev \
libxmlsec1-openssl \
libffi-dev \
build-essential \
python3-dev \
python3-qrcode \
&& rm -rf /var/lib/apt/lists/* \
&& pip3 install --upgrade pip \
2022-11-15 06:00:06 +01:00
&& pip3 install -r /opt/requirements_${Provider}.txt \
2023-04-15 07:46:22 +02:00
&& pip3 install git+https://${GITEA_USER}:${GITEA_PASSWORD}@gitea.onecluster.org/OneTeam/oc-facho.git@documento_soporte \
&& cd ${DIR_MODULES}
2022-01-05 21:59:15 +01:00
prefix="trytondo-"
2022-01-26 02:25:43 +01:00
team_org="OneTeam"
2022-06-03 15:02:35 +02:00
pip="False"
2022-11-15 06:00:06 +01:00
get_one_team=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org $Provider --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
clone_module $Provider ${TRYTOND_VERSION} $prefix "${get_one_team[@]}"
2022-01-05 21:59:15 +01:00
2022-06-03 15:02:35 +02:00
inactive_modules_trytondo=(
2022-11-15 06:00:06 +01:00
purchase_coffee
2022-06-03 15:02:35 +02:00
sale_payment_form
sale_pos_extras
2023-05-15 18:41:52 +02:00
optical_equipment
2022-06-03 15:02:35 +02:00
)
2022-06-25 23:48:27 +02:00
inactive_module "trytond-" $pip "${inactive_modules_trytondo[@]}"
2022-01-05 21:59:15 +01:00
fi
2022-11-15 06:00:06 +01:00
if [ "$Provider" == "OneTeam_Pos" ]; then
2022-06-03 15:11:47 +02:00
apt-get update \
&& apt-get install -y --no-install-recommends \
git \
pkg-config \
libxml2-dev \
libxmlsec1-dev \
libxmlsec1-openssl \
libffi-dev \
build-essential \
python3-dev \
python3-qrcode \
2023-06-15 03:41:05 +02:00
python3-ipython \
2022-06-03 15:11:47 +02:00
&& rm -rf /var/lib/apt/lists/* \
&& pip3 install --upgrade pip \
&& pip3 install -r /opt/requirements_OneTeam.txt \
2023-04-15 07:46:22 +02:00
&& pip3 install git+https://${GITEA_USER}:${GITEA_PASSWORD}@gitea.onecluster.org/OneTeam/oc-facho.git@documento_soporte \
2022-11-15 06:00:06 +01:00
&& cd ${DIR_MODULES}
2022-06-03 15:11:47 +02:00
prefix="trytondo-"
team_org="OneTeam"
2022-11-15 06:00:06 +01:00
pip="False"
get_one_team=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org $team_org --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
clone_module $team_org ${TRYTOND_VERSION} $prefix "${get_one_team[@]}"
2022-06-03 15:11:47 +02:00
2022-11-15 06:00:06 +01:00
inactive_modules_trytondo=(
purchase_coffee
2022-06-03 15:11:47 +02:00
sale_payment
2022-11-15 06:00:06 +01:00
)
inactive_module "trytond-" $pip "${inactive_modules_trytondo[@]}"
2022-06-03 15:11:47 +02:00
modules_nantic=(
2022-11-15 06:00:06 +01:00
trytond-sale_w_tax
trytond-purchase_discount
2022-06-03 15:11:47 +02:00
trytond-sale_pos
trytond-sale_shop
trytond-sale_payment
trytond-purchase_discount
2022-11-15 06:00:06 +01:00
trytond-account_invoice_discount )
2022-06-03 15:11:47 +02:00
clone_module "NaNtic" ${TRYTOND_VERSION} "trytond-" "${modules_nantic[@]}"
fi
2022-11-15 06:00:06 +01:00
if [ "$Provider" == "Presik" ]; then
2022-01-05 21:59:15 +01:00
prefix="trytonpsk-"
team_org="Presik"
2023-06-03 02:57:12 +02:00
pip="False"
2022-01-05 21:59:15 +01:00
pip3 install --upgrade pip \
2022-11-15 06:00:06 +01:00
&& pip3 install -r /opt/requirements_${Provider}.txt
get_presik=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org ${Provider} --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
2023-06-03 02:57:12 +02:00
clone_module $Provider "master" $prefix "${get_presik[@]}"
2022-01-05 21:59:15 +01:00
inactive_modules_presik=(
2023-06-03 02:57:12 +02:00
audiovisual
2022-11-15 06:00:06 +01:00
document
document_collection
document_expiration
document_communication
2023-06-03 02:57:12 +02:00
account_aus
account_invoice_mail
account_invoice_party_revenue
electronic_mail_template
electronic_mail
2022-11-15 06:00:06 +01:00
staff_document
staff_document_alert
2022-01-05 21:59:15 +01:00
sale_pos_frontend
sale_pos_frontend_rest
sale_pos_commission
2023-06-03 02:57:12 +02:00
sale_pos_synchronize
maintenance-indicators
2022-11-15 06:00:06 +01:00
health
health_ambulance
health_calendar
health_co
health_functional
health_gloss
health_gyneco
2022-01-05 21:59:15 +01:00
health_history
2022-11-15 06:00:06 +01:00
health_icd10
2022-01-05 21:59:15 +01:00
health_inpatient
2022-11-15 06:00:06 +01:00
health_lab
health_lifestyle
health_nursing
health_optometry
health_orthanc
health_pediatrics
health_services
health_socioeconomics
health_stock
health_who_essential_medicines
2023-06-03 02:57:12 +02:00
hotel_zak
real_estate
2022-01-05 21:59:15 +01:00
smtp
2022-11-15 06:00:06 +01:00
sms
2023-06-03 02:57:12 +02:00
vps
2022-01-05 21:59:15 +01:00
)
inactive_module $prefix $pip "${inactive_modules_presik[@]}"
modules_nantic=(trytond-smtp)
clone_module "NaNtic" ${TRYTOND_VERSION} "trytond-" "${modules_nantic[@]}"
fi
2022-11-15 06:00:06 +01:00
if [ "$Provider" == "Datalife" ]; then
2022-01-05 21:59:15 +01:00
prefix="trytond-"
team_org="Datalife"
pip="False"
apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
libffi-dev \
&& pip3 uninstall -y trytond-incoterm \
&& cd /usr/local \
2022-01-26 02:25:43 +01:00
&& git clone -b main https://${GITEA_USER}:${GITEA_PASSWORD}@git.disroot.org/NaNtic/python-edifact.git \
2022-01-05 21:59:15 +01:00
&& cd python-edifact \
&& ${PYTHON_VERSION} setup.py install \
2022-11-15 06:00:06 +01:00
&& cd /usr/local \
&& git clone -b ${TRYTOND_VERSION} https://${GITEA_USER}:${GITEA_PASSWORD}@git.disroot.org/Datalife/tryton_replication.git \
&& cd tryton_replication \
&& ${PYTHON_VERSION} setup.py install \
&& cd /usr/local \
&& git clone -b ${TRYTOND_VERSION} https://${GITEA_USER}:${GITEA_PASSWORD}@git.disroot.org/Datalife/tryton_rpc.git \
&& cd tryton_rpc \
&& ${PYTHON_VERSION} setup.py install \
2022-01-05 21:59:15 +01:00
&& cd $DIR_MODULES \
&& rm -rf incoterm \
&& pip3 install --upgrade pip \
2022-11-15 06:00:06 +01:00
&& pip3 install -r /opt/requirements_${Provider}.txt
inactive_modules_trytond=(
sale_payment)
inactive_module "trytond-" $pip "${inactive_modules_trytond[@]}"
2022-01-05 21:59:15 +01:00
2022-11-15 06:00:06 +01:00
get_datalife=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org $Provider --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
clone_module $Provider ${TRYTOND_VERSION} $prefix "${get_datalife[@]}"
2022-01-05 21:59:15 +01:00
inactive_modules_datalife=(
edw_mssql
2022-11-15 06:00:06 +01:00
sale_cost_apply_purchase
agro_sale_board_harvest_request
label_printer
stock_label_printer
account_payment_confirming_n68
electronic_mail_scheduler
electronic_mail_wizard )
2022-01-05 21:59:15 +01:00
inactive_module $prefix $pip "${inactive_modules_datalife[@]}"
modules_nantic=(
trytond-account_payment_type
trytond-company_bank
trytond-account_invoice_company_currency
trytond-jasper_reports
trytond-stock_scanner
trytond-stock_valued
trytond-stock_kit
trytond-sale_kit
trytond-account_payment_type
trytond-edocument_unedifact
trytond-account_move_draft
trytond-account_payment_receipt
trytond-product_barcode )
clone_module "NaNtic" ${TRYTOND_VERSION} $prefix "${modules_nantic[@]}"
fi
2022-11-15 06:00:06 +01:00
if [ "$Provider" == "NaNtic" ]; then
2022-01-05 21:59:15 +01:00
prefix="trytond-"
team_org="NaNtic"
pip="False"
apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
libffi-dev \
libldap2-dev \
libsasl2-dev \
libcups2-dev \
2022-11-15 06:00:06 +01:00
libpq-dev \
2022-01-05 21:59:15 +01:00
&& pip3 install --upgrade pip \
2022-11-15 06:00:06 +01:00
&& cd /opt \
&& git clone --branch ${TRYTOND_VERSION} ${gitea_url}${Provider}/tryton-config.git \
&& pip3 install -r tryton-config/requirements.txt \
&& pip3 install -r /opt/requirements_${Provider}.txt
get_nantic=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org $Provider --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
clone_module $Provider ${TRYTOND_VERSION} $prefix "${get_nantic[@]}"
inactive_modules_nantic=(patches
tryton-config
)
2022-01-05 21:59:15 +01:00
inactive_module $prefix $pip "${inactive_modules_nantic[@]}"
fi
2022-11-15 06:00:06 +01:00
if [ "$Provider" == "Kalenis" ]; then
2022-01-05 21:59:15 +01:00
team_org="kalenis"
branch="master"
apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
wget \
2022-11-15 06:00:06 +01:00
&& pip3 install --upgrade pip \
&& pip3 install -r /opt/requirements_${Provider}.txt \
&& git clone -b ${branch} ${gitea_url}${Provider}/kalenislims.git \
2022-01-05 21:59:15 +01:00
&& mv kalenislims/lims* ${DIR_MODULES} \
&& rm -rf kalenislims \
2022-11-15 06:00:06 +01:00
&& git clone -b ${branch} ${gitea_url}${Provider}/kalenis_user_view.git \
2022-01-05 21:59:15 +01:00
&& mv kalenis_user_view ${DIR_MODULES}/user_view \
&& wget https://downloads.kalenislims.com/frontend_dist_${TRYTOND_VERSION}.tar.gz \
&& tar -xzf frontend_dist_${TRYTOND_VERSION}.tar.gz \
&& rm -rf /var/lib/trytond/www \
&& mv frontend_dist_${TRYTOND_VERSION} /var/lib/trytond/www
fi
2022-11-15 06:00:06 +01:00
if [ "$Provider" == "GnuHealth" ]; then
name_tar="gnuhealth-4.0.4"
if [ "$TRYTOND_VERSION" == "5.0" ]; then
name_tar="gnuhealth-3.8.0"
fi
2022-01-05 21:59:15 +01:00
apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
wget \
libldap2-dev \
libsasl2-dev \
ldap-utils \
tox \
lcov \
valgrind \
&& pip3 install --upgrade pip \
2022-11-15 06:00:06 +01:00
&& pip3 install -r /opt/requirements_${Provider}.txt \
2022-01-05 21:59:15 +01:00
&& cd /tmp \
2022-11-15 06:00:06 +01:00
&& wget https://ftp.gnu.org/gnu/health/${name_tar}.tar.gz \
&& tar -xzf ${name_tar}.tar.gz \
&& mv ${name_tar}/health* ${DIR_MODULES} \
&& rm -rf ${name_tar}
if [ "$TRYTOND_VERSION" == "5.0" ]; then
mv ${DIR_MODULES}/health_webdav3_server ${DIR_MODULES}/webdav
mv ${DIR_MODULES}/health_caldav ${DIR_MODULES}/calendar
fi
2022-01-05 21:59:15 +01:00
fi
2022-11-15 06:00:06 +01:00
if [ "$Provider" == "Trytonar" ]; then
2022-01-05 21:59:15 +01:00
prefix="False"
team_org="tryton-ar"
pip="False"
apt-get install -y --no-install-recommends \
wget \
unzip \
build-essential \
python3-dev \
libxslt-dev \
libffi-dev \
libssl-dev \
swig \
unzip \
&& cd /opt \
&& git clone https://github.com/reingart/pyafipws.git \
&& cd pyafipws \
2022-11-15 06:00:06 +01:00
&& ${PYTHON_VERSION} setup.py install \
2022-01-05 21:59:15 +01:00
&& pip3 install --upgrade pip \
2022-11-15 06:00:06 +01:00
&& pip3 install -r /opt/requirements_${Provider}.txt \
&& cd ${DIR_MODULES}
2022-01-05 21:59:15 +01:00
get_trytonar=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org $team_org --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
clone_module $team_org ${TRYTOND_VERSION} $prefix "${get_trytonar[@]}"
inactive_modules_trytonar=(
documentacion-tryton-ar
tryton-demo-ar
tryton-capacitacion-tecnica
company_ar_NO_USAR
tryton-ar.github.io
deploy-localizacion-argentina_DEPRECATE
TUBA2015
padron_afip_ar_DEPRECATE
)
inactive_module $prefix $pip "${inactive_modules_trytonar[@]}"
fi