forked from ConPaaS-team/conpaas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkdist.sh
85 lines (72 loc) · 2.1 KB
/
mkdist.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
if [ -z "$1" ]
then
echo "Usage: $0 conpaas_version (eg: $0 1.1.0)"
exit 1
fi
CPSVERSION="$1"
# prepare director's contents
rm -rf conpaas-director/conpaas
mkdir -p conpaas-director/conpaas
cp -a conpaas-services/config/ conpaas-director/conpaas
cp -a conpaas-services/scripts/ conpaas-director/conpaas
# build PDF manual
cd docs
make latexpdf
cp _build/latex/ConPaaS.pdf ../conpaas-director
make clean
cd ..
# build conpaas archive and ship it with the director
echo '###### build conpaas archive and ship it with the director'
cd conpaas-services
sh mkarchive.sh > ../SERVICES.LOG 2>&1
cd ..
if [ `cat SERVICES.LOG | wc -l` -gt 3 ]
then
cat SERVICES.LOG
exit 1
fi
mv conpaas-services/ConPaaS.tar.gz conpaas-director
# build cpsclient and cpslib
echo '###### build cpsclient and cpslib'
for d in "conpaas-client" "conpaas-services/src"
do
cd $d
sed -i s/'^CPSVERSION =.*'/"CPSVERSION = \'$CPSVERSION\'"/ setup.py
python setup.py clean
python setup.py sdist
python setup.py clean
cd -
done > CLIENT+LIB.LOG 2>&1
grep -i error CLIENT+LIB.LOG && exit 1
# build cpsdirector
echo '###### build cpsdirector'
cd conpaas-director
sed -i s/'^CPSVERSION =.*'/"CPSVERSION = \'$CPSVERSION\'"/ setup.py
make source > ../DIRECTOR.LOG 2>&1 || exit 1
cd ..
grep -i error DIRECTOR.LOG && exit 1
# build cpsfrontend
echo '###### build cpsfrontend'
cp -a conpaas-frontend cpsfrontend-$CPSVERSION
find cpsfrontend-$CPSVERSION -type d -name .svn | xargs rm -rf
tar cfz cpsfrontend-$CPSVERSION.tar.gz cpsfrontend-$CPSVERSION
rm -rf cpsfrontend-$CPSVERSION
# build cps-tools
echo '###### build cps-tools'
cd cps-tools
sed -i "s/AC_INIT(\[cps-tools\], \[\(.*\)\]/AC_INIT(\[cps-tools\], \[$CPSVERSION\]/" configure.ac
./configure && make dist
mv cps-tools-$CPSVERSION.tar.gz ..
cd ..
for f in `find conpaas-{client,director,services/src}/dist -type f -name \*.tar.gz`
do
mv $f .
done
# cleaning up
find . -name \*.egg-info -type d |xargs rm -rf
echo ======= cleaning up ======= >> DIRECTOR.LOG
cd conpaas-director && make clean >> ../DIRECTOR.LOG
cd ..
echo "TARBALLS BUILT:"
ls *$CPSVERSION*.tar.gz