diff options
-rw-r--r-- | ant/tomcat-common.xml | 15 | ||||
-rwxr-xr-x | scripts/setup-tomcat.sh | 12 |
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} |