-
Notifications
You must be signed in to change notification settings - Fork 1
/
package_and_deploy.sh
executable file
·66 lines (48 loc) · 1.23 KB
/
package_and_deploy.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
#!/bin/bash
PATH=/bin:/usr/bin:/usr/sbin
VERSION=$FANTASTICO_VERSION
WORKDIR=`pwd`
if [ -z $VERSION ]; then
echo "You must provide a fantastico version to package."
exit 1
fi
# Publish release code.
echo "Create release tag $VERSION"
git tag -a v$VERSION -m "Fantastico version $VERSION released."
if [ $? -gt 0 ]; then
exit $?
fi
git push origin v$VERSION
# Publish release documentation.
echo "Create release doc tag $VERSION"
cd ../fantastico-doc
git tag -a v$VERSION-doc -m "Fantastico doc version $VERSION released."
if [ $? -gt 0 ]; then
exit $?
fi
git push origin v$VERSION-doc
if [ $? -gt 0 ]; then
exit $?
fi
# Publish Fantastico on PyPi.
cd $WORKDIR/doc
echo "Removing previous doc build."
rm -Rf build
mkdir build
cd build
ln -s ../../../fantastico-doc/doctrees doctrees
ln -s ../../../fantastico-doc/epub epub
ln -s ../../../fantastico-doc/html html
ln -s ../../../fantastico-doc/latex latex
cd $WORKDIR
cp -f doc/source/changes.rst CHANGES.txt
cat README.txt CHANGES.txt >> README_NEW.txt
rm -f README.txt
rm CHANGES.txt
mv README_NEW.txt README.txt
echo "Publishing Fantastico $VERSION on PyPi."
python3 setup.py clean sdist register upload
if [ $? -gt 0 ]; then
exit $?
fi
echo "Fantastico $VERSION released successfully."