forked from invitu/env_invitu_dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy_odoo17_production.sh
50 lines (49 loc) · 1.43 KB
/
deploy_odoo17_production.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/bash
workspace=/var/opt/odoo/17.0/
## Welcome message
echo "Bonjour, bienvenue dans l'outil de déploiement odoo automatique"
echo "Indiquez la date des MAJ (AAAAMMJJ)"
#Read date in the assigned variable
read date
cd /root
for i in `/bin/ls *_$date.tar.gz`
do
echo $i
if [[ $i == *"invitu_"$date".tar.gz" ]]; then
module=${i%_v17_invitu_"$date"\.tar\.gz}
echo "INVITU"
echo $module
folder="$module"_"$date"
echo $folder
cd $workspace/invitu-addons
/bin/tar xvzf /root/$i
/bin/rm $module -f
/bin/ln -s $folder $module
cd $workspace/other-addons
/bin/ln -s ../invitu-addons/$module
elif [[ $i == "theme_"*$date".tar.gz" ]]; then
module=${i%_v17_"$date"\.tar\.gz}
echo "THEME"
echo $module
folder="$module"_"$date"
echo $folder
cd $workspace/themes_sources
/bin/tar xvzf /root/$i
/bin/rm $module -f
/bin/ln -s $folder $module
cd $workspace/themes
/bin/ln -s ../themes_sources/$module
else
module=${i%_v17_special_"$date"\.tar\.gz}
echo "SPECIAL"
echo $module
folder="$module"_"$date"
echo $folder
cd $workspace/special-addons
/bin/tar xvzf /root/$i
/bin/rm $module -f
/bin/ln -s $folder $module
cd $workspace/other-addons
/bin/ln -s ../special-addons/$module
fi
done