-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-release.sh
executable file
·56 lines (39 loc) · 1.81 KB
/
build-release.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
#!/bin/bash
VERSION=`date +%Y%m%d`
EDITOR=vi
function isokay() {
local ok
echo "$* (y/N)"
read ok
test "x$ok" == "xy"
}
function die() {
echo "$*"
exit 1
}
export EDITOR
(cd fitnesse && git pull origin master) || die "Can not update submodule fitnesse"
(cd fitnessedotorg && git pull origin master) || die "Can not update submodule fitnessedotorg"
echo "Releasing $VERSION."
isokay "Is all cruft removed from the frontpage?" || exit
isokay "Is the ReleaseNotes page up to date?" || exit
(cd fitnesse && git status) && isokay "Is okay?" || exit
(cd fitnesse && ./gradlew clean && ./gradlew sign publish -x test) || exit
isokay "Is the distro okay?" || exit
(cd fitnesse && ./gradlew release -x test) || exit
echo "Copying fitnesse-standalone.jar to fitnesse.org"
mkdir fitnessedotorg/releases/$VERSION
cp fitnesse/build/libs/fitnesse-$VERSION-standalone.jar fitnessedotorg/releases/$VERSION/fitnesse-standalone.jar || die "Can not copy fitnesse-standalone.jar"
echo "Setup fitnesse.org to use $VERSION"
cp fitnessedotorg/base.ivy.xml fitnessedotorg/ivy.xml
ed fitnessedotorg/ivy.xml << EOF
14s/version/$VERSION/g
w
EOF
echo "Generate static pages"
rm -rf fitnessedotorg/docs fitnessedotorg/FitNesseRoot/FitNesse fitnessedotorg/FitNesseRoot/TemplateLibrary fitnessedotorg/FitNesseRoot/properties
rm fitnessedotorg/plugins.properties
java -jar fitnesse/build/libs/fitnesse-$VERSION-standalone.jar -d fitnessedotorg -c "?publish&destination=fitnessedotorg/docs" -p 8080 || die "Cannot generate static pages"
echo "Commit all and push"
(cd fitnessedotorg && git checkout plugins.properties docs/CNAME && git add ivy.xml docs releases/$VERSION && git commit -v -m "Release $VERSION via $0" || { git stash; die "Not committed (stashed), nothing to do."; }; ) \
&& (cd fitnessedotorg && git push origin HEAD:master)