Add targets for SP install (non-interactive)
authorgilbert <gilbert@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 1 Jun 2005 18:38:41 +0000 (18:38 +0000)
committergilbert <gilbert@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 1 Jun 2005 18:38:41 +0000 (18:38 +0000)
Generate two keys for idp.example.org and sp.example.org

git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1600 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

build.xml

index c9c5bec..2044666 100755 (executable)
--- a/build.xml
+++ b/build.xml
             </fileset>
         </delete>
     </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="${shib.home}" />
+               <delete dir="${shibsp.home}" />
+               <delete dir="${tomcat.home}/webapps/${shib.webapp.name}" />
+               <delete dir="${tomcat.home}/webapps/${shibsp.webapp.name}" />
+       </target>
 
 
        <!-- Add to the classpath for unit tests -->
         <genSalt keyStorePath="${appconfig}/persistent.jks" keyStorePassword="shibhs" keyStoreKeyAlias="handleKey" keyStoreKeyPassword="shibhs" />
     </target>
        
-       <target name="exampleCertificate">
+       <target name="exampleCertificates">
+               <genkey alias="tomcat" storepass="exampleorg"
+                       keystore="${tomcat.home}/conf/idpexample.jks"
+                       keyalg="RSA" validity="365"
+                       dname="cn=idp.example.org, o=example.org, c=US"
+               />
                <genkey alias="tomcat" storepass="exampleorg"
-                       keystore="${tomcat.home}/conf/example.jks"
+                       keystore="${tomcat.home}/conf/spexample.jks"
                        keyalg="RSA" validity="365"
-                       dname="cn=shibboleth.example.org, o=example.org, c=US"
+                       dname="cn=sp.example.org, o=example.org, c=US"
                />
        </target>
 
         </if>
     </target>
 
+    <!-- Install Shibboleth SP to filesystem using the properties in build.properties -->
+    <target name="install.sp.filesystem" depends="init, install.init, build-util" 
+        description="Install Shibboleth SP to filesystem using the properties in build.properties">
+
+        <!-- copy values to deployment descriptor and create war -->
+        <copy file="${configroot}/dist.sp.xml" tofile="${configroot}/sp.xml" overwrite="true" />
+        <replace file="${configroot}/sp.xml" token="$SHIB_HOME$" value="${shibsp.home.url}" />
+        <war warfile="${dist}/${shibsp.webapp.name}.war" webxml="${configroot}/sp.xml" basedir="${approot}" update="no" />
+               <delete file="${configroot}/sp.xml"/>
+        <copy file="${dist}/${shibsp.webapp.name}.war" tofile="${tomcat.home}/webapps/${shibsp.webapp.name}.war" />
+
+        <!-- copy sp jars and utilities -->
+        <copy todir="${shibsp.home}/lib">
+            <fileset dir="lib" includesfile="conf/idp-lib.include" />
+        </copy>
+
+        <copy todir="${shibsp.home}/bin">
+            <fileset dir="bin"/>
+        </copy>
+               <chmod dir="${shibsp.home}/bin" perm="ug+rx" includes="**/*"/>
+
+        <mkdir dir="${shibsp.home}/logs" />
+
+        <!-- copy sp configuration -->
+        <if>
+            <or>
+                <equals arg1="${copy-sp-conf}" arg2="y" />
+                <not> <available file="${shibsp.home}/etc" /> </not>
+            </or>
+            <then>
+                <delete dir="${shibsp.home}/etc" />
+                <antcall target="install.sp.filesystem.config" />
+            </then>
+        </if>
+    </target>
+       
+       
     <!-- copy shibboleth configuration to $SHIB_HOME/etc, overwriting any existing configuration -->
        <target name="install.idp.filesystem.config" depends="init, install.init, install.url">
         <mkdir dir="${shib.home}/etc" />
                <move file="${shib.home}/etc/dist.idp.xml" tofile="${shib.home}/etc/idp.xml" overwrite="true" />
         <replace file="${shib.home}/etc/idp.xml" token="$SHIB_HOME$" value="${shib.home.url}" />
     </target>
+       
+    <!-- copy SP configuration to $SHIB_HOME$/etc, overwriting any existing configuration -->
+       <target name="install.sp.filesystem.config" depends="init, install.init">
+        <mkdir dir="${shibsp.home}/etc" />
+        <copy todir="${shibsp.home}/etc" overwrite="true">
+            <fileset dir="${src}/conf" includesfile="conf/sp-conf.include"/>
+        </copy>
+               <move file="${shibsp.home}/etc/dist.sp.xml" tofile="${shibsp.home}/etc/sp.xml" overwrite="true" />
+        <replace file="${shibsp.home}/etc/sp.xml" token="$SHIB_HOME$" value="${shibsp.home.url}" />
+    </target>
 
     <!-- install Shibboleth-IdP war using tomcat's manager app -->
        <target name="install.idp.manager" depends="init, install.init">
     <target name="savePropertyFile">
         <propertyfile file="build.properties">
             <entry key="shib.home" value="${shib.home}" />
+            <entry key="shibsp.home" value="${shibsp.home}" />
             <entry key="shib.webapp.name" value="${shib.webapp.name}" />
+            <entry key="shibsp.webapp.name" value="${shibsp.webapp.name}" />
             <entry key="idp.install-type" value="${idp.install-type}" />
             <entry key="tomcat.home" value="${tomcat.home}" />
             <entry key="tomcat.url" value="${tomcat.url}" />