Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Ant Scripts

Chapter 3
In addition to the Administration Tool, commandline interface tool, and REST interface, you can also configure components and stacks using a set of Silver Fabric Ant tasks, which are provided for Apache Ant. This alternative provides a method more granular than the CLI which can be easier to use in some configuration scenarios, and also provides an easy way to configure Silver Fabric from within an IDE with a built-in Ant support.
For more details on installation and tasks, refer "Silver Fabric Ant Scripts" in TIBCO Silver Fabric Developer’s Guide.
Samples
The Silver Fabric Command Line Interface installation contains a samples directory, which contains example build files using Ant tasks for several Enablers. See the enclosed Readme for more information on the examples.
You can also create a sample build.xml and build.properties based on any of your published stacks. See "Packaging stacks For Ant Task Deployment" in the TIBCO Silver Fabric Cloud Administrator’s Guide for more information.
You can use the fabric-cli.properties file from the Silver Fabrix installation along with the following files:
build.xml
The following is a sample build.xml file.
 
<project name="sfsp-build" default="release" basedir="." xmlns:sf="antlib:com.datasynapse.fabric.ant">
 
<property file="build.properties"/>
<property file="../../fabric-cli.properties" />
 
<sf:connection-props brokerurl="http://lin64cdc201.qa.datasynapse.com:8000" username="admin" password="admin" clientssltrustfile="${DSSSLTrustFile}" />
 
<target name="release" depends="release-component, release-stack"/>
<target name="clean" depends="clean-stack, clean-component"/>
<target name="release-component">
<echo message="Building ${component.name}" />
<sf:component action="create" name="${component.name}" description="${component.description}" type="${component.type}" enablername="${enabler.name}" enablerversion="${enabler.version}" utility="${utility}" />
 
<sf:option name="${component.name}" action="replace">
<sf:property name="Department" value="${department}" />
<sf:property name="Location" value="${location}" />
<sf:property name="Partition" value="${partition}" />
<sf:property name="Engine Blacklisting" value="false" />
<sf:property name="Failures Per Day Before Blacklist" value="0" />
<sf:property name="Archive Scale Up Timeout" value="${archive.scale.up.timeout}" />
<sf:property name="Archive Scale Down Timeout" value="${archive.scale.down.timeout}" />
<sf:property name="Maximum Deactivation Time" value="${deactivation.timeout}" />
<sf:property name="Maximum Activation Time" value="${activation.timeout}" />
<sf:property name="Maximum Capture Time" value="${maximum.capture.time}" />
<sf:property name="Maximum Instances Per Host" value="${max.instances.per.host}" />
<sf:property name="Separator Tags" value="${separator.tags}" />
<sf:property name="Statistics Collection Frequency" value="${stats.collection.frequency}" />
<sf:property name="Activation Delay" value="0" />
<sf:property name="Engine Reservation Expiration" value="${engine.reservation.expiration}" />
</sf:option>
 
<sf:default-settings name="${component.name}" action="update">
<sf:property name="Default Min Engines" value="${min}" />
<sf:property name="Default Max Engines" value="${max}" />
<sf:property name="Default Priority" value="${priority}" />
</sf:default-settings>
 
<sf:feature name="${component.name}" action="add" feature="Application Logging Support" />
<sf:feature name="${component.name}" action="update" feature="Application Logging Support">
<sf:property name="Archive Application Logs" value="${archive.logs}" />
<sf:property name="Checkpoint Frequency In Seconds" value="${checkpoint.frequency}" />
<sf:property name="Log File Pattern" value="${log.file.pattern}" />
</sf:feature>
 
<sf:feature name="${component.name}" action="add" feature="HTTP Support" />
<sf:feature name="${component.name}" action="update" feature="HTTP Support">
<sf:property name="HTTP Enabled" value="${http.enabled}" />
<sf:property name="HTTPS Enabled" value="${https.enabled}" />
<sf:property name="Routing Prefix" value="${routing.prefix}" />
<sf:property name="Route Directly To Endpoints" value="${routing.direct}" />
</sf:feature>
 
<sf:feature name="${component.name}" action="add" feature="Archive Management Support" />
<sf:feature name="${component.name}" action="update" feature="Archive Management Support">
<sf:property name="Start Archives On Activation" value="true" />
</sf:feature>
 
<sf:publish type="component" name="${component.name}" />
</target>
 
<target name="clean-component">
<echo message="Cleaning ${component.name}" />
<sf:unpublish type="component" name="${component.name}" onerror="ignore" />
<sf:remove type="component" name="${component.name}" onerror="ignore" />
</target>
 
<target name="release-stack">
<echo message="Building ${stack.name}" />
<sf:stack action="create" name="${stack.name}" description="${stack.description}"/>
<sf:stack-component action="add" name="${stack.name}" components="${component.name}" />
<sf:stack-policy action="update" name="${stack.name}">
<sf:policy manualpolicy="true">
<sf:compalloc component="${component.name}" min="${min}" max="${max}" priority="${priority}">
<sf:allocationrule type="Resource Preference">
<sf:property name="propertyName" value="os" />
<sf:property name="propertyValue" value="linux" />
<sf:property name="operator" value="contains" />
<sf:property name="affinityPos" value="2" />
</sf:allocationrule>
</sf:compalloc>
</sf:policy>
</sf:stack-policy>
 
<sf:publish type="stack" name="${stack.name}" />
</target>
 
<target name="clean-stack">
<echo message="Cleaning ${stack.name}" />
<sf:unpublish type="stack" name="${stack.name}" onerror="ignore" />
<sf:remove type="stack" name="${stack.name}" onerror="ignore" />
</target>
</project>
 
 
 
build.properties
Following is a sample of build.properties file.
 
# stack properties
stack.name=Example Stack for ${component.name}
stack.description=Example Stack for ${component.name} built by Ant
 
# component properties
component.name=SFSP Example Component
component.description=SFSP Example Component built by Ant
component.type=TIBCO ActiveMatrix Enabler for Adapter for SAP:3.0.0
enabler.name=TIBCO ActiveMatrix Enabler for Adapter for SAP container
enabler.version=3.0.0.0
utility=false
 
# load balancing
routing.direct=false
routing.prefix=${cluster.name}
 
# logging
archive.logs=true
log.file.pattern=\
/../domaindata/logs/domainutility.log,\
/../domaindata/tra/${TIBCO_DOMAIN_NAME}/logs/Hawk.log,\
/../domaindata/tra/${TIBCO_DOMAIN_NAME}/logs/tsm.log,\
/../domaindata/tra/${TIBCO_DOMAIN_NAME}/logs/msghma.log,\
/../domaindata/tra/${TIBCO_DOMAIN_NAME}/logs/ApplicationManagement.log,\
/../domaindata/tra/${TIBCO_DOMAIN_NAME}/application/logs/.*\.log
checkpoint.frequency=300
 
# instances
max.instances.per.host=1
min=1
max=4
priority=3
 
# http
http.enabled=true
https.enabled=true
 
# build directories
content.dir=content
configure.dir=configure
script.path=
 
# timeouts
archive.scale.up.timeout=120
archive.scale.down.timeout=120
activation.timeout=300
deactivation.timeout=120
maximum.capture.time=300
stats.collection.frequency=120
engine.reservation.expiration=300
 
# options
department=
location=
partition=
separator.tags=
 

Copyright © TIBCO Software Inc. All Rights Reserved