gerrit/tools/release.sh
Shawn O. Pearce e6fc72f381 Include formatted HTML documentation in WAR
This way the documentation for that release is embedded within the
WAR and can be served directly from the servlet container that is
running Gerrit Code Review itself.  This should make it easier to
look up the relevant information from a running installation.

The documentation menu is only installed in the UI if the server
has the "Documentation/" subdirectory within the servlet context.
This should be true if the server was packaged with our release
script, but otherwise would be false as its not there.

Its probably more GWT-ey to use some sort of build parameter in
the module definition to enable or disable this menu creation
code at compile time, allowing GWT to strip out the resources and
JavaScript if the documentation wasn't available at build time.
But this is far too complex for our needs.  The documentation is
most likely going to be present, and its only a handful of bytes
for the strings.  Any minor savings resulting from being able to
strip this code out just isn't worth the additional code complexity.

Change-Id: Ib2be63cf99fa20ff427ab811ab25d5e9e8a6b21f
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-02-22 09:38:49 -08:00

40 lines
690 B
Bash
Executable File

#!/bin/sh
include_docs=-Dgerrit.include-documentation=1
while [ $# -gt 0 ]
do
case "$1" in
--no-documentation|--without-documentation)
include_docs=
shift
;;
*)
echo >&2 "usage: $0 [--without-documentation]"
exit 1
esac
done
git update-index -q --refresh
if test -n "$(git diff-index --name-only HEAD --)" \
|| test -n "$(git ls-files --others --exclude-standard)"
then
echo >&2 "error: working directory is dirty, refusing to build"
exit 1
fi
./tools/version.sh --release &&
mvn clean package $include_docs
rc=$?
./tools/version.sh --reset
if test 0 = $rc
then
echo
echo Built Gerrit Code Review `git describe`:
ls gerrit-war/target/gerrit-*.war
echo
fi
exit $rc