Statistics
| Revision:

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

History | View | Annotate | Download (3.2 kB)

1 728 mdecorde
version="0.6.1"
2 728 mdecorde
STEP=$1
3 728 mdecorde
4 728 mdecorde
outdir="TXM_Portal_${version}"
5 728 mdecorde
rm -rf "$outdir"
6 728 mdecorde
mkdir "$outdir"
7 728 mdecorde
if [ $? != 0 ]; then
8 728 mdecorde
	echo "** Portals.sh : failed to create dir $outdir"
9 728 mdecorde
	exit 1;
10 728 mdecorde
fi
11 728 mdecorde
12 728 mdecorde
# copy debian shared files: INSTALL, LICENCE, ...
13 728 mdecorde
cp -r shared/portals/* "$outdir"
14 728 mdecorde
if [ $? != 0 ]; then
15 728 mdecorde
	echo "** Portals.sh : failed to copy shared files in dir $outdir"
16 728 mdecorde
	exit 1;
17 728 mdecorde
fi
18 728 mdecorde
19 728 mdecorde
# get manuals from SVN
20 728 mdecorde
svn update "$HOME/SVN/TXMSVN/trunk/doc" &&
21 728 mdecorde
cp "$HOME/SVN/TXMSVN/trunk/doc/admin manuals//Manuel du portail TXM 0.6.1 - admin.pdf" "$outdir/doc" &&
22 728 mdecorde
cp "$HOME/SVN/TXMSVN/trunk/doc/dev manuals/Manuel de reference TXMWEB Dev 0.3_FR.pdf" "$outdir/doc"
23 728 mdecorde
if [ $? != 0 ]; then
24 728 mdecorde
	echo "** Portals.sh : failed to copy documentation"
25 728 mdecorde
	exit 1;
26 728 mdecorde
fi
27 728 mdecorde
28 728 mdecorde
# build txm.war
29 728 mdecorde
pwd
30 728 mdecorde
currentdir=`pwd`
31 728 mdecorde
WARDIR="$HOME/workspace079/org.txm.web/war"
32 728 mdecorde
cd $WARDIR &&
33 728 mdecorde
rm -f txm.war &&
34 728 mdecorde
./buildWar.sh "txm" &&
35 728 mdecorde
cd $currentdir
36 728 mdecorde
if [ $? != 0 ]; then
37 728 mdecorde
	echo "** Portals.sh : failed to build txm.war file"
38 728 mdecorde
	exit 1;
39 728 mdecorde
fi
40 728 mdecorde
41 728 mdecorde
pwd
42 728 mdecorde
# copy war build
43 728 mdecorde
cp -r "$WARDIR/txm.war" "$outdir"
44 728 mdecorde
if [ $? != 0 ]; then
45 728 mdecorde
	echo "** Portals.sh : failed to copy war file in dir $outdir"
46 728 mdecorde
	exit 1;
47 728 mdecorde
fi
48 728 mdecorde
49 728 mdecorde
# remove temporary and SVN files
50 728 mdecorde
echo " cleaning TXM_Portal_${version} directory"
51 728 mdecorde
bash directoryCleaner.sh "TXM_Portal_${version}"
52 728 mdecorde
53 728 mdecorde
# copy .TXMWEB configuration directory (must be done after temp file cleaning)
54 728 mdecorde
# remove test files and personnal path
55 728 mdecorde
echo "copying '.TXMWEB/war' directories"
56 728 mdecorde
mkdir "$outdir/.TXMWEB"
57 728 mdecorde
cp -r "$HOME/.TXMWEB/war" "$outdir/.TXMWEB/txm"
58 728 mdecorde
if [ $? != 0 ]; then
59 728 mdecorde
	echo "** Portals.sh : failed to copy war file in dir $outdir"
60 728 mdecorde
	exit 1;
61 728 mdecorde
fi
62 728 mdecorde
63 728 mdecorde
# remove all references to $HOME
64 728 mdecorde
echo "remove all references to $HOME"
65 728 mdecorde
find $outdir/.TXMWEB/* -type f -exec sed -i "s#$HOME#<user_home>#g" {} \;
66 728 mdecorde
if [ $? != 0 ]; then
67 728 mdecorde
	echo "** Portals.sh : failed to replace $HOME references in $outdir/.TXMWEB/*"
68 728 mdecorde
	exit 1;
69 728 mdecorde
fi
70 728 mdecorde
71 728 mdecorde
# erase SMTP setup in txmweb.conf
72 728 mdecorde
echo "erase SMTP setup in $outdir/.TXMWEB/txm/txmweb.conf"
73 728 mdecorde
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.host=.*#mail.host=#g" {} \; &&
74 728 mdecorde
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.user=.*#mail.user=#g" {} \; &&
75 728 mdecorde
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.default.from=.*#mail.default.from=#g" {} \; &&
76 728 mdecorde
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.default.reply=.*#mail.default.reply=#g" {} \; &&
77 728 mdecorde
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.password=.*#mail.password=#g" {} \; &&
78 728 mdecorde
find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.contact=.*#mail.contact=#g" {} \; &&
79 728 mdecorde
80 728 mdecorde
if [ $? != 0 ]; then
81 728 mdecorde
	echo "** Portals.sh : failed to remove all references to the SMTP setup in $outdir/.TXMWEB/txm/txmweb.conf"
82 728 mdecorde
	exit 1;
83 728 mdecorde
fi
84 728 mdecorde
85 728 mdecorde
# build
86 728 mdecorde
echo "building 'TXM_Portal_${version}.zip' file"
87 728 mdecorde
zip -9 -r -q "TXM_Portal_${version}.zip" "TXM_Portal_${version}"
88 728 mdecorde
if [ $? != 0 ]; then
89 728 mdecorde
	echo "** Portals.sh : failed to zip $outdir"
90 728 mdecorde
	exit 1;
91 728 mdecorde
fi
92 728 mdecorde
93 728 mdecorde
# send to shared files
94 728 mdecorde
echo "Sending to ensldfs.ens-lyon.fr/services//Laboratoires/labo_ana_corpus/Projets/Textométrie/Logiciel/TXM"
95 728 mdecorde
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 728 mdecorde
if [ $? != 0 ]; then
97 728 mdecorde
	echo "** Portals.sh : failed to send TXM_Portal_${version}.zip to labo_ana_corpus"
98 728 mdecorde
	exit 1;
99 728 mdecorde
fi