Module to compile SOA composites


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')['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


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:

<target name=»scac-validate» depends=»init»>
<echo message=»Running scac-validate in ${scac.input}»/>
<!–<antcall target=»scac» inheritall=»true»/>–> <!– FIX –>