This is "unsafe" as it may miss changes in gwtorm, gwtjsonrpc, jgit or mina_sshd, but it runs in 38 seconds vs. 2 minutes to do a full clean build and test. It also packages too much into the WAR, old compiled copies of the JavaScript are left laying around. Signed-off-by: Shawn O. Pearce <sop@google.com>
47 lines
1010 B
Bash
Executable File
47 lines
1010 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Builds and deploys into Jetty; primarily for debugging
|
|
|
|
jetty=$1
|
|
fast=$2
|
|
if [ -z "$jetty" ]
|
|
then
|
|
echo >&2 "usage: $0 jettydir [--fast]"
|
|
exit 1
|
|
fi
|
|
if ! [ -f "$jetty/etc/jetty.xml" ]
|
|
then
|
|
echo >&2 "error: $jetty is not a Jetty installation"
|
|
exit 1
|
|
fi
|
|
|
|
ctx="$jetty/contexts/gerrit.xml" &&
|
|
|
|
if [ -f "$ctx" -a -n "$fast" ]
|
|
then
|
|
echo >&2 "warning: Using fast mode to build only GWT..."
|
|
echo >&2
|
|
(cd appjar && mvn install) &&
|
|
(cd appwar && mvn package) &&
|
|
cp appwar/target/gerrit-*.war "$jetty/webapps/gerrit.war" &&
|
|
touch "$ctx"
|
|
else
|
|
(cd appdist && mvn clean install) &&
|
|
out=$(cd appdist/target/gerrit-*-bin.dir/gerrit-* && pwd) &&
|
|
|
|
cp $out/www/gerrit-*.war "$jetty/webapps/gerrit.war" &&
|
|
if [ -f "$ctx" ]
|
|
then
|
|
touch "$ctx"
|
|
else
|
|
cp $out/jdbc/c3p0-*.jar "$jetty/lib/plus" &&
|
|
cp $out/jdbc/postgresql-*jdbc*.jar "$jetty/lib/plus" &&
|
|
|
|
rm -f "$jetty/contexts/test.xml" &&
|
|
cp $out/www/jetty_gerrit.xml "$ctx" &&
|
|
|
|
echo >&2 &&
|
|
echo >&2 "You need to edit and configure $ctx"
|
|
fi
|
|
fi
|