Wednesday 18 September 2013

Undeploy multiple SOA composites using ANT

We have a requirement in the current project for a solution to undeploy multiple composites at one time using script. So that we can have nightly build and deployment.
As per my knowledge we don't have direct solution to undeploy  all composites in one shot like soa 10g without deleting domain.
we can delete the partition and recreate the partition.

The below code snippet is suitable for separate targets for each composite.

We have to refer the ant-sca-mgmt.xml with our custom ant target.

<import file="/utilities/ant-sca-mgmt.xml"/>

Below is the code snippet, you can use to remove  all composites of the given partition as well as the partition itself.

<antcall target="deletePartition" inheritall="false">

<param name="platform" value="weblogic"/>
<param name="host" value="vinodfusion"/>      
<param name="port" value="8001"/>      
<param name="user" value="weblogic"/>      
<param name="password" value="welcome1"/>      
<param name="partition" value="default"/>  

</antcall>
<antcall target="createPartition" inheritall="false">

<param name="platform" value="weblogic"/>  
<param name="host" value="vinodfusion"/>      
<param name="port" value="8001"/>      
<param name="user" value="weblogic"/>      
<param name="password" value="welcome1"/>      
<param name="partition" value="default"/>    

</antcall>