-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen-snapshot.sh
executable file
·67 lines (47 loc) · 1.88 KB
/
gen-snapshot.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
#/bin/sh
# Script for generating nightly Booktype snapshot packages
# Set GITPATH to the directory containing the Booktype source
# Set PKGPATH to the directory containing the packaging scripts
VERSION=2.0.0~$(date "+%Y%m%d")
REVISION=1
GITPATH=~/64studio/git/booktype/
PKGPATH=~/64studio/git/booktype-packaging/
BUILDDEST=/tmp/booktype-${VERSION}/
ORIGBALL=/tmp/booktype_${VERSION}.orig.tar.gz
echo "cleaning up previous build..."
rm -rf /tmp/booktype-*
mkdir ${BUILDDEST}
echo "copying Booktype files to temporary directory..."
cd ${GITPATH}
git checkout 2.0
git pull origin 2.0
cp -a * ${BUILDDEST} || exit
cd ${BUILDDEST} || exit
# Build the documentation then move it into place
python setup.py build_sphinx
rm -r docs/_build
mv build docs/_build
echo "creating the source tarball..."
tar -cvzf ${ORIGBALL} *
echo "copying the packaging files..."
cp -a ${PKGPATH}debian ${BUILDDEST} || exit
# Set the version of the snapshot package
sed -i "1s:(2.0.0-1):(${VERSION}-${REVISION}):g" debian/changelog
# Fixes for 2.0.0 #############
# moved to debian/copyright
rm LICENSE.txt
rm lib/booktype/apps/edit/static/edit/js/aloha/plugins/common/align/LICENSE
rm lib/booktype/apps/edit/static/edit/js/aloha/plugins/extra/flag-icons/img/flags/LICENSE
# fix permissions
chmod +x scripts/cron_reports.sh.original
chmod +x scripts/cron_reports_weekly.sh.original
chmod +x lib/booktype/skeleton/manage.py.original
chmod +x lib/sputnik/redis-backuo.py
#############################
echo "running the build..."
debuild -d -uc -us $@ || exit
# copy the new package to the public server
# scp /tmp/booktype_${VERSION}-${REVISION}_all.deb apt.sourcefabric.org:/var/www/apt/snapshots/
# copy the build log and changes too
# scp /tmp/booktype_${VERSION}-${REVISION}_amd64.build apt.sourcefabric.org:/var/www/apt/snapshots/
# scp /tmp/booktype_${VERSION}-${REVISION}_amd64.changes apt.sourcefabric.org:/var/www/apt/snapshots/