summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2013-04-03 20:57:20 -0700
committerJesse Morgan <jesse@jesterpm.net>2013-04-03 20:57:20 -0700
commit368aa83b6ac9a38b9dfd183659b19cc1ba3947b3 (patch)
treecc74bf019b1ef4f66004cfeea0e15e60802fd156
parent4678933a672ced8f2a9b9bb7b3737dbce0bbd676 (diff)
Added tomcat-setup target.
-rw-r--r--ant/tomcat-common.xml15
-rwxr-xr-xscripts/setup-tomcat.sh12
2 files changed, 19 insertions, 8 deletions
diff --git a/ant/tomcat-common.xml b/ant/tomcat-common.xml
index d349943..dc2ace9 100644
--- a/ant/tomcat-common.xml
+++ b/ant/tomcat-common.xml
@@ -12,17 +12,17 @@
<import file="build-common.xml" />
<path id="catalina-ant-classpath">
- <fileset dir="${catalina.home}/bin">
+ <fileset dir="${catalina.home}/bin" erroronmissingdir="false">
<include name="*.jar"/>
</fileset>
- <fileset dir="${catalina.home}/lib">
+ <fileset dir="${catalina.home}/lib" erroronmissingdir="false">
<!-- <include name="*.jar"/> -->
</fileset>
</path>
<taskdef resource="org/apache/catalina/ant/catalina.tasks"
- classpathref="catalina-ant-classpath" />
+ classpathref="catalina-ant-classpath" onerror="report" />
<target name="prepare" depends="build-common.prepare"
description="Create the build directories">
@@ -87,4 +87,13 @@
</target>
+ <target name="setup-tomcat" unless="catalina.home">
+ <input message="Enter a tomcat password (stored in plaintext):"
+ addproperty="manager.password" />
+ <exec executable="${jesterpm.buildtools.root}/scripts/setup-tomcat.sh"
+ inputstring="${manager.password}">
+ <arg line="${manager.password}" />
+ </exec>
+ </target>
+
</project>
diff --git a/scripts/setup-tomcat.sh b/scripts/setup-tomcat.sh
index d6137ac..0a21053 100755
--- a/scripts/setup-tomcat.sh
+++ b/scripts/setup-tomcat.sh
@@ -2,6 +2,8 @@
TOMCAT_VERSION="7.0.39"
+PASSWORD=$1
+
if [ -e $HOME/opt/tomcat ]; then
echo "Tomcat appears to already be installed at $HOME/opt/tomcat. Skipping..."
exit 1
@@ -17,8 +19,10 @@ ln -s apache-tomcat-${TOMCAT_VERSION} tomcat
# Configure
-echo -n "Enter a tomcat password (stored in plaintext): "
-read -s PASSWORD
+if [ -z "$PASSWORD" ]; then
+ echo -n "Enter a tomcat password (stored in plaintext): "
+ read -s PASSWORD
+fi
rm tomcat/conf/tomcat-users.xml
cat > tomcat/conf/tomcat-users.xml << EOF
@@ -34,9 +38,7 @@ EOF
chmod 600 tomcat/conf/tomcat-users.xml
# Create the build.properties for other projects
-echo > tomcat/conf/build.properties << EOF
-
-# From ${HOME}/opt/tomcat/conf/build.properties
+cat > tomcat/conf/build.properties << EOF
catalina.home=${HOME}/opt/tomcat
manager.username=${USER}
manager.password=${PASSWORD}