diff --git a/bitclone.sh b/bitclone.sh index ba6b565..bef9c38 100644 --- a/bitclone.sh +++ b/bitclone.sh @@ -1,21 +1,27 @@ -#!/bin/sh +#!/bin/bash + source ~/.virtualenvs/tryton50/bin/activate + + # Define your function here bitClone () { - echo "Cloning remote Presik repo from Bitbucket... $1" - cd source - hg clone https://hg@bitbucket.org/presik/trytonpsk_$1 - cd trytonpsk_$1 - python setup.py install - if [ ! -z $2 ] - then - echo "Updating database... $2" - trytond-admin -v -c ~/.trytond/trytond.conf -d $2 -u $1 - fi + echo "Cloning remote Presik repo from Bitbucket... $1" + sudo rm -r source/* + cd source + git clone https://presik@bitbucket.org/presik/trytonpsk-$1.git + cd trytonpsk-$1 + python setup.py install + if [ ! -z $2 ] + then + echo "Updating database... $2" + trytond-admin -v -c ~/.trytond/trytond.conf -u $1 -d $2 + fi } # Invoke your function bitClone "$1" "$2" + + diff --git a/create_virtualenv_next50.sh b/create_virtualenv_next50.sh index 362613b..01e08a8 100644 --- a/create_virtualenv_next50.sh +++ b/create_virtualenv_next50.sh @@ -28,7 +28,7 @@ echo '----------------------------------------------------------' version='5.0' max_version='5.1' integer_version='50' -venv='tryton'${integer_version} +venv='tryton51' nameuser='psk' file_bashrc=${HOME}'/.bashrc' @@ -96,7 +96,6 @@ for i in ${pippackages} tryton_modules=" - trytond country party currency @@ -152,10 +151,12 @@ tryton_modules=" sale_stock_quantity " +pip3 install trytond==5.0.21 + message "[INFO] Installing official Tryton packages..." ${BLUE} for i in ${tryton_modules} do - ${PIP_CMD} install "trytond_$i>=$version,<$max_version" --no-deps + ${PIP_CMD} install "trytond_$i==5.0" --no-deps done message "[INFO] Done. " ${YELLOW} @@ -242,8 +243,8 @@ modules=" for i in ${modules} do - hg clone https://presik@bitbucket.org/presik/trytonpsk_$i - cd $i + git clone https://presik@bitbucket.org/presik/trytonpsk-$i.git + cd trytonpsk-$i ${PYT_CMD} setup.py install cd .. done diff --git a/mupdate.sh b/mupdate.sh index 8699379..87ea24e 100644 --- a/mupdate.sh +++ b/mupdate.sh @@ -6,37 +6,40 @@ nameuser='psk' +homex='/home/'${nameuser} venv='tryton50' -dir_source=$HOME'/source/' -databases=" - DEMO -" +dir_source=$homex'/source/' +databases=$(psql -d postgres -c "SELECT datname FROM pg_database WHERE datallowconn='true' AND datname != 'postgres' AND datname NOT LIKE '%template%'") modules="$@" echo Number of arguments: $# echo Arguments: ${modules} - +i=0 souhome() { - workon $venv - echo Removing all under: ${dir_source} - rm -R ${dir_source}* - for module in ${modules} - do - hg clone https://presik@bitbucket.org/presik/trytonpsk_${module} - mv trytonpsk_${module} ${dir_source} - cd ${dir_source}trytonpsk_${module} - python setup.py install - done - for DB in ${databases} - do - echo "Database Target -----------------> " $DB - trytond-admin -v -c ~/.trytond/trytond.conf -d $DB -u ${module} - done + workon $venv + echo Removing all under: ${dir_source} + sudo rm -R ${dir_source}* + for module in ${modules} + do + git clone https://presik@bitbucket.org/presik/trytonpsk-${module}.git + mv trytonpsk-${module} ${dir_source} + cd ${dir_source}/trytonpsk-${module} + python setup.py install + done + for DB in ${databases} + do + echo "Database Target -----------------> " $DB + trytond-admin -v -c ~/.trytond/trytond.conf -d $DB -u ${module} + done } souhome -sudo systemctl restart strytond +sudo systemctl stop strytond + +sudo systemctl start strytond cd .. +cd .. + diff --git a/new_cloud.sh b/new_cloud.sh index 9e84cf5..5ccfc03 100644 --- a/new_cloud.sh +++ b/new_cloud.sh @@ -3,9 +3,7 @@ # As root apt update apt upgrade -apt install -y build-essential -apt install -y postgresql -apt install -y git +apt install -y build-essential postgresql git python3-pip python3-dev python3-venv python-gtk2 python-setuptools postgresql-server-dev-11 libffi-dev libpq-dev python3-virtualenv python3-simplejson apt autoremove locale-gen en_US en_US.UTF-8