Statistics
| Revision:

root / tmp / org.txm.setups / BuildPortals.sh @ 1120

History | View | Annotate | Download (3.2 kB)

1
version="0.6.1"
2
STEP=$1
3

    
4
outdir="TXM_Portal_${version}"
5
rm -rf "$outdir"
6
mkdir "$outdir"
7
if [ $? != 0 ]; then
8
	echo "** Portals.sh : failed to create dir $outdir"
9
	exit 1;
10
fi
11

    
12
# copy debian shared files: INSTALL, LICENCE, ...
13
cp -r shared/portals/* "$outdir"
14
if [ $? != 0 ]; then
15
	echo "** Portals.sh : failed to copy shared files in dir $outdir"
16
	exit 1;
17
fi
18

    
19
# get manuals from SVN
20
svn update "$HOME/SVN/TXMSVN/trunk/doc" &&
21
cp "$HOME/SVN/TXMSVN/trunk/doc/admin manuals//Manuel du portail TXM 0.6.1 - admin.pdf" "$outdir/doc" &&
22
cp "$HOME/SVN/TXMSVN/trunk/doc/dev manuals/Manuel de reference TXMWEB Dev 0.3_FR.pdf" "$outdir/doc"
23
if [ $? != 0 ]; then
24
	echo "** Portals.sh : failed to copy documentation"
25
	exit 1;
26
fi
27

    
28
# build txm.war
29
pwd
30
currentdir=`pwd`
31
WARDIR="$HOME/workspace079/org.txm.web/war"
32
cd $WARDIR &&
33
rm -f txm.war &&
34
./buildWar.sh "txm" &&
35
cd $currentdir
36
if [ $? != 0 ]; then
37
	echo "** Portals.sh : failed to build txm.war file"
38
	exit 1;
39
fi
40

    
41
pwd
42
# copy war build
43
cp -r "$WARDIR/txm.war" "$outdir"
44
if [ $? != 0 ]; then
45
	echo "** Portals.sh : failed to copy war file in dir $outdir"
46
	exit 1;
47
fi
48

    
49
# remove temporary and SVN files
50
echo " cleaning TXM_Portal_${version} directory"
51
bash directoryCleaner.sh "TXM_Portal_${version}"
52

    
53
# copy .TXMWEB configuration directory (must be done after temp file cleaning)
54
# remove test files and personnal path
55
echo "copying '.TXMWEB/war' directories"
56
mkdir "$outdir/.TXMWEB"
57
cp -r "$HOME/.TXMWEB/war" "$outdir/.TXMWEB/txm"
58
if [ $? != 0 ]; then
59
	echo "** Portals.sh : failed to copy war file in dir $outdir"
60
	exit 1;
61
fi
62

    
63
# remove all references to $HOME
64
echo "remove all references to $HOME"
65
find $outdir/.TXMWEB/* -type f -exec sed -i "s#$HOME#<user_home>#g" {} \;
66
if [ $? != 0 ]; then
67
	echo "** Portals.sh : failed to replace $HOME references in $outdir/.TXMWEB/*"
68
	exit 1;
69
fi
70

    
71
# erase SMTP setup in txmweb.conf
72
echo "erase SMTP setup in $outdir/.TXMWEB/txm/txmweb.conf"
73
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.host=.*#mail.host=#g" {} \; && 
74
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.user=.*#mail.user=#g" {} \; && 
75
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.default.from=.*#mail.default.from=#g" {} \; && 
76
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.default.reply=.*#mail.default.reply=#g" {} \; && 
77
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.password=.*#mail.password=#g" {} \; &&
78
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.contact=.*#mail.contact=#g" {} \; &&  
79

    
80
if [ $? != 0 ]; then
81
	echo "** Portals.sh : failed to remove all references to the SMTP setup in $outdir/.TXMWEB/txm/txmweb.conf"
82
	exit 1;
83
fi
84

    
85
# build
86
echo "building 'TXM_Portal_${version}.zip' file"
87
zip -9 -r -q "TXM_Portal_${version}.zip" "TXM_Portal_${version}"
88
if [ $? != 0 ]; then
89
	echo "** Portals.sh : failed to zip $outdir"
90
	exit 1;
91
fi
92

    
93
# send to shared files
94
echo "Sending to ensldfs.ens-lyon.fr/services//Laboratoires/labo_ana_corpus/Projets/Textométrie/Logiciel/TXM"
95
smbclient -A auth.txt "//ensldfs.ens-lyon.fr/services" -c "cd \"/Laboratoires/labo_ana_corpus/Projets/Textométrie/Logiciel/TXM\" ; put TXM_Portal_${version}.zip ; exit"
96
if [ $? != 0 ]; then
97
	echo "** Portals.sh : failed to send TXM_Portal_${version}.zip to labo_ana_corpus"
98
	exit 1;
99
fi