[NEW] Changes locations for downloaded repos. Script to update repos

This commit is contained in:
Jorge Enrique Gómez Gómez 2021-06-11 07:16:18 -05:00
parent 885f1929c8
commit 67fd317581
4 changed files with 165 additions and 55 deletions

8
.gitignore vendored
View File

@ -1,4 +1,4 @@
odoo/ community/
v14_avancys_agofer/ core/
Community/ custom/
Extended/ vendor/

View File

@ -17,63 +17,21 @@ To be installed into this directory structure:
└── vendor [Developed by an Odoo partner under contract] └── vendor [Developed by an Odoo partner under contract]
``` ```
## Repositories ## To download or update code from repositories:
### Odoo 14.0 core
**Location:** `/odoo`
To clone from source:
```sh ```sh
git clone --single-branch --depth 1 --branch 14.0 https://github.com/odoo/odoo.git ./update_from_repo.sh [-h] -o={all|core|community|vendor|custom}
```
### Avancys v14 for Agofer
**Location:** `/v14_avancys_agofer`
To clone from source:
```sh
git clone git@gitlab.com:mgarcia.avancys/v14_avancys_agofer.git
```
### Custom in-house modules
**Location:** `/Extended`
To clone from source:
```sh
git clone ssh://git@gitea.agofer.net:22001/Agofer/Extended.git
```
### Modules by Odoo Community Association
**Location:** `/Community`
To clone from source:
```sh
git clone --recurse-submodules \
ssh://git@gitea.agofer.net:22001/Agofer/Community.git
```
Subsequent updates:
```
git pull --recurse-submodules
``` ```
## To install into the production structure: ## To install into the production structure:
```sh ```sh
sudo ./install_all.sh sudo ./install_odoo_code.sh [-h] -o={all|core|community|vendor|custom}
``` ```
### To apply patches to installed modules: ## To apply patches to installed code:
```sh ```sh
sudo ./apply_patches.sh sudo ./apply_patches.sh [-h] -o={all|core|community|vendor}
``` ```

View File

@ -25,7 +25,7 @@ Help ()
cp_core () cp_core ()
{ {
REPO="Odoo 14.0 core" REPO="Odoo 14.0 core"
SRC=./odoo/ SRC=./core/
DEST=$DESTDIR/core/ DEST=$DESTDIR/core/
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Install $REPO into production directory structure" echo "Install $REPO into production directory structure"
@ -37,7 +37,7 @@ cp_core ()
cp_community () cp_community ()
{ {
REPO="Modules by Odoo Community Association" REPO="Modules by Odoo Community Association"
SRC=./Community/oca SRC=./community/oca
DEST=$DESTDIR/community/ DEST=$DESTDIR/community/
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Install $REPO into production directory structure" echo "Install $REPO into production directory structure"
@ -52,7 +52,7 @@ cp_community ()
cp_vendor () cp_vendor ()
{ {
REPO="Avancys v14 for Agofer" REPO="Avancys v14 for Agofer"
SRC=./v14_avancys_agofer/ SRC=./vendor/
DEST=$DESTDIR/vendor/ DEST=$DESTDIR/vendor/
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Install $REPO into production directory structure" echo "Install $REPO into production directory structure"
@ -66,7 +66,7 @@ cp_vendor ()
cp_custom () cp_custom ()
{ {
REPO="Custom in-house modules " REPO="Custom in-house modules "
SRC=./Extended/ SRC=./custom/
DEST=$DESTDIR/custom/ DEST=$DESTDIR/custom/
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Install $REPO into production directory structure" echo "Install $REPO into production directory structure"

152
update_from_repo.sh Executable file
View File

@ -0,0 +1,152 @@
#!/bin/bash
#
# Updates code from the git repositories selected
#
Help ()
{
echo "Usage: $0 [-h] -o={all|core|community|vendor|custom}"
echo
echo "Options:"
echo "-h Help (display this text)"
echo "-o Repositories to be updated (one of 'all', 'core', 'community', 'vendor',"
echo " 'custom'). Required."
echo
}
gt_core ()
{
REPO="Odoo 14.0 core"
SRC=https://github.com/odoo/odoo.git
DEST=./core/
OPTIONS="--single-branch --depth 1 --branch 14.0"
if [ ! -d "$DEST" ]; then
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Clone $REPO"
echo " …to $DEST"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
git clone $OPTIONS $SRC $DEST
else
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Update $REPO"
echo " …in $DEST"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
git -C $DEST pull
fi
}
gt_community ()
{
REPO="Modules by Odoo Community Association"
SRC=ssh://git@gitea.agofer.net:22001/Agofer/Community.git
DEST=./community/
OPTIONS="--recurse-submodules"
if [ ! -d "$DEST" ]; then
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Clone $REPO"
echo " …to $DEST"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
git clone $OPTIONS $SRC $DEST
else
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Update $REPO"
echo " …in $DEST"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
git -C $DEST pull $OPTIONS
fi
}
gt_vendor ()
{
REPO="Avancys v14 for Agofer"
SRC=git@gitlab.com:mgarcia.avancys/v14_avancys_agofer.git
DEST=./vendor/
OPTIONS=""
if [ ! -d "$DEST" ]; then
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Clone $REPO"
echo " …to $DEST"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
git clone $OPTIONS $SRC $DEST
else
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Update $REPO"
echo " …in $DEST"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
git -C $DEST pull
fi
}
gt_custom ()
{
REPO="Custom in-house modules"
SRC=ssh://git@gitea.agofer.net:22001/Agofer/Extended.git
DEST=./custom/
OPTIONS=""
if [ ! -d "$DEST" ]; then
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Clone $REPO"
echo " …to $DEST"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
git clone $OPTIONS $SRC $DEST
else
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Update $REPO"
echo " …in $DEST"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
git -C $DEST pull
fi
}
gt_all ()
{
gt_core # Download from repo Odoo core
gt_community # Download from repo OCA modules
gt_vendor # Download from repo Avancys modules
gt_custom # Download from repo Custom modules
}
if (($# == 0))
then
Help
exit
fi
while getopts ":ho:" option; do
case $option in
h) # display Help
Help
exit;;
o) # Enter a name
Modules=$OPTARG;;
*) # Invalid option
echo "Error: Invalid option"
echo
Help
exit;;
esac
done
case $Modules in
'all') # Download from repo all modules
gt_all
exit;;
'core') # Download from repo Odoo core
gt_core
exit;;
'community') # Download from repo OCA modules
gt_community
exit;;
'vendor') # Download from repo Avancys modules
gt_vendor
exit;;
'custom') # Download from repo Custom modules developed in-house
gt_custom
exit;;
*) # Invalid option
echo "Error: Invalid module"
echo
Help
exit;;
esac