Module to compile SOA composites
#!/usr/bin/python #miguel.ortiz import os, sys, time import subprocess compositeRealPath = 'C:/Users/m.ortiz/.babun/cygwin/home/m.ortiz/repo/SOA/SomeService' scAntpath = 'C:/Oracle/Middleware/jdeveloper/jdeveloper/bin/' antBin = 'ant-sca-package.xml' compositeName = '/composite.xml' def compilarSOA ( compositeRealPath, revisionNumber) : mystdout = open(compositeRealPath + '/deploy/' + 'log_' + time.strftime("%Y%m%d-%H%M%S") + '.log', 'w') subprocess.call(['ant', '-f', 'C:/Oracle/Middleware/jdeveloper/jdeveloper/bin/ant-sca-package.xml', '-DcompositeDir=' + compositeRealPath, '-DcompositeName=composite.xml', '-Drevision=' + revisionNumber ], stdout=mystdout) compilarSOA( compositeRealPath, revisionNumber)
Module to obtain each composite version
#!/usr/bin/python #miguel.ortiz import fnmatch, os compositeName = '/composite.xml' def getComposites( baseRepoDir, aCompilarProject ): compositesList = [] # listado de composites for root, dirnames, filenames in os.walk(baseRepoDir + aCompilarProject): for filename in fnmatch.filter(filenames, 'composite.xml'): compositesList.append(os.path.join(root, filename)) # agregar composites encontrados a la lista for composite in compositesList : return composite def getRealCompositesPaths ( pathComposite ) : realCompositesPaths = [] # listado de composites realCompositePath = os.path.dirname( pathComposite ) realCompositesPaths.append(realCompositePath) # agregar composites encontrados a la lista for dirComposite in realCompositesPaths : return dirComposite
If you use MDS you may need to comment out this in ant-sca-package.xml:
https://support.oracle.com/knowledge/Middleware/1143723_1.html
<target name=»scac-validate» depends=»init»>
<echo message=»Running scac-validate in ${scac.input}»/>
<!–<antcall target=»scac» inheritall=»true»/>–> <!– https://stackoverflow.com/questions/14576534/building-soa-composite-application-using-ant FIX –>
</target>