Add Build SP to install target
authorgilbert <gilbert@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 15 Sep 2005 15:06:40 +0000 (15:06 +0000)
committergilbert <gilbert@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 15 Sep 2005 15:06:40 +0000 (15:06 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1857 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

build.xml

index d165131..2c6509a 100755 (executable)
--- a/build.xml
+++ b/build.xml
                        </then>
                </if>
        </target>
+       
+       <target name="installx" depends="init, install.init" description="Interactive SP Install">
+               <if>
+                       <xinput type="confirm" defaultvalue="y">Do you want to install the Shibboleth Service Provider?</xinput>
+                       <then>
+                               <input message="What name do you want to use for the Service Provider web application? [default: ${sp.webapp.name}]" 
+                                       addproperty="sp.webapp.name.input" defaultValue="${sp.webapp.name}" />
+                               <var name="sp.webapp.name" value="${sp.webapp.name.input}" />
+
+                               <antcall target="install.sp" />
+                       </then>
+               </if>
+       </target>
 
        <target name="install.idp" depends="init, install.init">
                <xinput message="Deploying the java web application.  Do you want to install it directly onto the filesystem or use the tomcat manager application?" 
 
                <antcall target="install.idp.${idp.install-type}" />
        </target>
+       
+       <target name="install.sp" depends="init, install.init">
+               <xinput message="Deploying the java web application.  Do you want to install it directly onto the filesystem or use the tomcat manager application?" 
+                       addproperty="sp.install-type.input" type="menu" casesensitive="no" defaultValue="${sp.install-type}">
+                       <xoption value="filesystem.prompt">filesystem</xoption>
+                       <xoption>manager</xoption>
+               </xinput>
+               <var name="sp.install-type" value="${sp.install-type.input}" />
+
+               <antcall target="install.sp.${sp.install-type}" />
+       </target>
 
        <!-- Prompt user for filesystem installation options and save them to build.properties -->
        <target name="install.idp.filesystem.prompt" depends="init, install.init">
                <antcall target="install.idp.filesystem" />
                <antcall target="savePropertyFile" />
        </target>
+       
+       <!-- Prompt user for filesystem installation options and save them to build.properties -->
+       <target name="install.sp.filesystem.prompt" depends="init, install.init">
+               <input message="Select a home directory for the Shibboleth Service Provider [default: ${sp.home}]"
+                       addproperty="sp.home.input" defaultvalue="${sp.home}" />
+               <var name="sp.home" value="${sp.home.input}" />
+               <input message="Enter tomcat home directory [default: ${tomcat.home}]"
+                       addproperty="tomcat.home.input" defaultvalue="${tomcat.home}" />
+               <var name="tomcat.home" value="${tomcat.home.input}" />
+
+               <if>
+                       <available file="${sp.home}/etc" />
+                       <then>
+                               <echo>--------------------------------------------------------------------------------------</echo>
+                               <echo>---</echo>
+                               <echo>---   NOTE:  Existing Service Provider configuration at ${sp.home}/etc ${line.separator}---   will not be overwritten.</echo>
+                               <echo>---</echo>
+                               <echo>--------------------------------------------------------------------------------------</echo>
+                               <property name="copy-sp-conf" value="n" />
+                       </then>
+                       <else>
+                               <property name="copy-sp-conf" value="y" />
+                       </else>
+               </if>
+
+               <antcall target="install.sp.filesystem" />
+               <antcall target="savePropertyFile" />
+       </target>
 
        <!-- Install Shibboleth IdP to filesystem using the properties in build.properties -->
        <target name="install.idp.filesystem" depends="init, install.init, build-util, install.url, package-idp" 
 
                <!-- Move SP war to Tomcat deployment directory -->
                <copy file="${dist}/${sp.webapp.name}.war" tofile="${tomcat.home}/webapps/${sp.webapp.name}.war" />
+               
+               <!-- Move Shib Filter jar to Tomcat shared directory -->
+               <copy file="${distlibs}/shib-filter.jar" tofile="${tomcat.home}/shared/lib/shib-filter.jar" />
+               
+               <!-- Copy test secure application to Tomcat -->
+               <copy file="${root}/data/secure.war" tofile="${tomcat.home}/webapps/secure.war" />
 
                <!-- copy sp jars and utilities -->
                <copy todir="${sp.home}/lib">
                        <entry key="tomcat.password" value="${tomcat.password}" />
                </propertyfile>
        </target>
+       <!-- For IDE development, run this target first to delete all
+       directories generated by the install process before
+       recreating and reinstalling everything. -->
+       <target name="clean-install" depends="init" 
+               description="Delete old configuration and Tomcat webapp directories.">
+               <delete dir="${idp.home}" />
+               <delete dir="${sp.home}" />
+               <delete dir="${tomcat.home}/webapps/${idp.webapp.name}" />
+               <delete dir="${tomcat.home}/webapps/${sp.webapp.name}" />
+       </target>
 </project>