#!/bin/bash # # Installs selected content from the downloaded repos into a production folder # if [ $UID != 0 ]; then echo "You need administration privileges to run this script." exit 1 fi DESTDIR=/opt/odoo OPTIONS="-av --exclude-from=common_exclude_patterns.txt --chown odoo:odoo" cp_core () { REPO="Odoo 14.0 core" SRC=./odoo/ DEST=$DESTDIR/core/ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "Copy $REPO into production directory structure" echo " …from $SRC to $DEST" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" rsync $OPTIONS $SRC $DEST } cp_vendor () { REPO="Avancys v14 for Agofer" SRC=./v14_avancys_agofer/ DEST=$DESTDIR/vendor/ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "Copy $REPO into production directory structure" echo "(selected modules)" echo " …from $SRC to $DEST" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" rsync $OPTIONS --exclude-from=rejected_proprietary_modules.txt \ $SRC $DEST } cp_custom () { REPO="Custom in-house modules " SRC=./Extended/ DEST=$DESTDIR/custom/ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "Copy $REPO into production directory structure" echo " …from $SRC to $DEST" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" rsync $OPTIONS $SRC $DEST } cp_community () { REPO="Modules by Odoo Community Association" SRC=./Community/oca DEST=$DESTDIR/community/ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "Copy $REPO into production directory structure" echo "(selected modules)" echo " …from $SRC to $DEST" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" for i in $(cat selected_oca_modules.txt) do rsync $OPTIONS $SRC/${i%/} $DEST done } cp_core # Copy Odoo core cp_vendor # Copy Avancys modules cp_custom # Copy Custom modules cp_community # Copy OCA modules