Using this simple script we can undeploy SOA composites deployed on a Oracle SOA partition.
We can do this by creating a xml file and a shell script where we will embed this xml file.
ORACLE provides an out of the box deploy and undeploy xml files which makes use of ant to perform the job. We are creating the deploy.xml and undeploy.xml to include this out of the box files.
At first we need to create a xml file with the below tags:
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="manualUndeploy" default="build">
<target name="build">
<echo>Undeploying...</echo>
<ant antfile="ant-sca-deploy.xml" inheritall="false" target="undeploy">
<property name="serverURL" value="http://172.22.112.244:7001"/>
<property name="user" value="weblogic"/>
<property name="password" value="hower@123"/>
<property name="compositeName" value="agreementfalling"/>
<property name="revision" value="10.0"/>
<property name="partition" value="default"/>
<property name="failOnError" value="true"/>
</ant>
</target>
</project>
The second step is to create a simple UNIX shell script, which can be used to invoke this xml file.
#!/bin/bash
# This is used to invoke the undeploy.xml
. /var/domain/soa_dev02/soa_dev02_domain/bin/setDomainEnv.sh
ant -f /home/soadev02/undeploy.xml
The setDomainEnv.sh will set the environment variables and the wls jars in the classpath.You can create a more interactive and dynamic script by using variables instead of the hard coded path which I have done,that I leave it up to you folks on how to do.