-
Notifications
You must be signed in to change notification settings - Fork 15
/
release-plugin
executable file
·53 lines (40 loc) · 1.31 KB
/
release-plugin
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
#!/bin/bash
#
# Build a plugin, copy it to the release directory, and insert it to a CHK using
# the node on $fcpPort.
#
# Load configuration and utility functions.
source freenet-scripts-common || exit
if [[ -z "$1" ]]; then
cat <<EOF
Usage: $0 [plugin name]
Requires that "$freenetRoot/plugin-[plugin name]" contains a repository built
with ant.
EOF
exit 1
fi
plugin="$1"
makeBuildDir
git clone "$freenetRoot/plugin-$plugin" "$buildDir/$plugin" || exit 11
echo "Clone complete"
pushd "$buildDir"
ln -s "$fredDir" "fred"
pushd "$plugin"
ant || exit
# TODO: Should this always release the current HEAD? Not the latest tag?
gitVersion="$(git describe --always --abbrev=40)"
name="$plugin-$gitVersion"
# For a plugin with underscores in its name (like Freemail_wot) the build
# product is expected to be named just that before the first underscore.
distJarName="$(echo $plugin | cut -d "_" -f 1).jar"
jarName="$name.jar"
mv "dist/$distJarName" "$jarName" || exit 4
sha1sum "$jarName" > "$jarName.sha1"
sourceName="$name-source.tar.bz2"
git archive --format=tar "$gitVersion" | bzip2 -cz > "$sourceName"
# TODO: Is a source archive checksum desirable?
require "Release $name?"
cp "$jarName" "$releaseDir/$plugin.jar" || exit 5
echo "Started insert"
put "$jarName" "application/x-java-archive"
put "$sourceName" "application/x-bzip"