forked from hyphanet/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testnet-build
executable file
·67 lines (67 loc) · 3.74 KB
/
testnet-build
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/bash
MAINVER=`cat /usr/src/cvs/eclipse-workspace/FreenetReleased/testnet.mainver`
TEMPLOC=`mktemp -d`
echo Copying testnet source to $TEMPLOC
cp -a /usr/src/cvs/eclipse-workspace/testnet/ $TEMPLOC
echo Copied data
cd $TEMPLOC/testnet/
GITVERSION=`cat /usr/src/cvs/eclipse-workspace/FreenetReleased/testnet.tag`
VERSION=`cat /usr/src/cvs/eclipse-workspace/FreenetReleased/testnet.build`
echo Testnet git version is $GITVERSION version is $VERSION
git checkout $GITVERSION || exit
git reset --hard
rm -Rf tmp*
ant clean -Dsuppress.gjs=false || exit
rm -Rf build/ lib/
cp -a . ../testnet-clean
mkdir lib 2>/dev/null
cp /usr/src/cvs/eclipse-workspace/FreenetReleased/freenet-ext.jar lib/freenet-ext.jar || exit
mkdir lib/freenet; cp lib/freenet-ext.jar lib/freenet/
REQUIRED_EXT=`cat src/freenet/node/NodeStarter.java | sed -n "s/^.*REQUIRED_EXT_BUILD_NUMBER = \([0-9]*\).*$/\1/p"`
RECOMMENDED_EXT=`cat src/freenet/node/NodeStarter.java | sed -n "s/^.*RECOMMENDED_EXT_BUILD_NUMBER = \([0-9]*\).*$/\1/p"`
if [[ -n $REQUIRED_EXT ]]; then echo Required ext: $REQUIRED_EXT; else echo Required ext version not found; exit 3; fi
if [[ -n $RECOMMENDED_EXT ]]; then echo Recommended ext: $RECOMMENDED_EXT; else echo Recommended ext version not found; exit 3; fi
echo "contrib.version.min=$REQUIRED_EXT" >> override.properties
echo "contrib.version.rec=$RECOMMENDED_EXT" >> override.properties
ant -f build-clean.xml || exit
eval `ssh-agent -s`
ssh-add
# Jars
mv dist/freenet-testnet.jar testnet-${GITVERSION}.jar || exit
sha1sum testnet-${GITVERSION}.jar > testnet-${GITVERSION}.jar.sha1
cp testnet-${GITVERSION}.jar ~toad
echo Copying testnet-${GITVERSION}.jar*
cp testnet-${GITVERSION}.jar* /usr/src/cvs/eclipse-workspace/FreenetReleased/testnet/ || exit
rm /usr/src/cvs/eclipse-workspace/FreenetReleased/testnet.jar
ln -s /usr/src/cvs/eclipse-workspace/FreenetReleased/testnet/testnet-${GITVERSION}.jar /usr/src/cvs/eclipse-workspace/FreenetReleased/testnet.jar
su - toad -c "gpg --sign --detach-sign testnet-${GITVERSION}.jar"
cp ~toad/testnet-${GITVERSION}.jar.sig .
rm ~toad/testnet-${GITVERSION}.jar*
cp testnet-${GITVERSION}.jar* /var/lib/freenet-experimental/
cp testnet-${GITVERSION}.jar.sig /usr/src/cvs/eclipse-workspace/FreenetReleased/testnet/ || exit
rsync -vz testnet-${GITVERSION}.jar* osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/
echo Uploaded new snapshot to emu
rm testnet-${GITVERSION}.jar*
echo "http://downloads.freenetproject.org/alpha/testnet-${GITVERSION}.jar" > ../freenet-testnet-latest.jar.url
rsync -vz ../freenet-testnet-latest.jar.url osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/freenet-testnet-latest.jar.url
rsync -vz ../freenet-testnet-latest.jar.url osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/freenet-testnet-latest.jar.url
ssh osprey.vm.bytemark.co.uk -- "cp /var/www/downloads/alpha/.registry .; cat /var/www/downloads/alpha/.registry | sed \"s/freenet-testnet-latest.jar .*$/freenet-testnet-latest.jar testnet-${GITVERSION}.jar/\" > new-registry ; cat new-registry > /var/www/downloads/alpha/.registry"
echo Uploaded new pointers
cd ..
rm -Rf testnet
mv testnet-clean testnet
cd testnet
git checkout $GITVERSION || exit
rm -Rf .git
tar cjf ../testnet-${GITVERSION}-source.tar.bz2 .
cp ../testnet-${GITVERSION}-source.tar.bz2* ~toad/
su - toad -c "gpg --sign --detach-sign testnet-${GITVERSION}-source.tar.bz2"
cp ~toad/testnet-${GITVERSION}-source.tar.bz2.sig ..
cp ../testnet-${GITVERSION}-source.tar.bz2* ~browser/
chmod a+r ~browser/testnet-${GITVERSION}-source.tar.bz2
rsync -vz ../testnet-${GITVERSION}-source.tar.bz2 osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/testnet-${GITVERSION}-source.tar.bz2
cp ../testnet-${GITVERSION}-source.tar.bz2* /usr/src/cvs/eclipse-workspace/FreenetReleased/testnet/
echo Uploaded source code to emu
rm -Rf $TEMPLOC
cd
ssh-agent -k