<img src="//bat.bing.com/action/0?ti=5129185&amp;Ver=2" height="0" width="0" style="display: none; visibility: hidden;">

Tibco continuous integration part 1 - automated building and deployment

Due to it's popularity, this post has been migrated here from a previous staff blog. It may be outdated or missing information. 

Continuous integration for a Tibco project - part 1

This is a first in a series of articles explaining how we achieved continuous integration for a Tibco project. In short, continuous integration aims at assembling a team's deliverables and provide timely feedback about the integrated work. The key components of continuous integration are:

In this article we'll be exploring the automated build for a Tibco project, and it is assumed that you already have people and a repository.

Why an automated build and who uses it

The automated build is responsible for recreating the application and it also makes the calls to provide feedback reports. Automated builds are used by individual developers as well as by the continuous integration machine. For Tibco projects, the automated build I am about to describe looks like:

Prerequisites

The build tool used is ant 1.7.x; a prior knowledge of ant is assumed. Furthermore, the Tibco products we used are the following:

The build scripts we'll be presenting have only been tested with the above configuration.

Automated build step by step

Please also note that the snippets that are presented refer to ant variables that might not be defined in the examples.The full build scripts are included in the attachments.

Clean and init

Remove all previous generated artifacts.

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     

 

Compile

Tibco code is mostly xml, hence the concept of compiling like in java or .NET does not translate directly. On the other hand Tibco provides a way to validate the source code and this proves to be quite useful. Validation makes call to a command line utility provided by Tibco and looks like:

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
        
        
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     


 

Configure and package

Once the code has been validated, it is configured for deployment.

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
         
         
         
         
         
         
        
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
      
   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
        
        
        
        
        
        
        
        
        
        
        
        
      

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     

Going over the steps, init simply copies all useful files to a temporary directory. Create-ear calls a TRA utility to create the enterprise archive. Please note that an .archive file is expected and that .archive file can be created using by using Designer to create an enterprise archive. Please note that this is an important step. The contents of the enterprise archive will determine what will be deployed on the application server. Finally, config creates a minimal deployment file using another Tibco utility; AppManage. The next step is to take the minimal configuration file and fill the details about where the archives will be deployed. Furthermore, global variables will be overwritten and included in the deployment instructions. This is accomplished with the following script:

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
        
        
        
        
        
        
        
        
        
        
      

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
      
   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
         
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
         
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
         
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     


The updateGlobalVariables target reads a property file containing global variables that should be overwritten and includes them in the deployment instructions. This target also calls a custom java library that does the overwriting (please forgive me, I am first and foremost a java guy). Finally, the tibco.xml file is removed from the ear so that the new deployment instructions are taken into account.

Deploy

Deployment is once again accomplished by calling the Tibco AppManage utility. As a matter of fact, the application is undeployed, deleted and then deployed, as it is unsafe to assume what will be found on the application server. The three activities are accomplished as follows:

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
      

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
      
   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     


Naturally, a Tibco domain is expected to be configured and started prior to using these scripts. Furthermore, please note that the project is deployed, undeployed and deleted using the ant project name (${ant.project.name})

Example use

Now that we have seen the targets in details, it is time to put them together. Consider a project called "BWUnit". This project would import the base-build.xml, the non-deployable-build.xml as well as the deployable-build.xml. Furthermore, the build for this project would overwrite any property it needed.



   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
        
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
         
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      
	
    
    
    
    
    
    
    
    
    
    
    
    
    
      
      
      
      
      
      
      
       
      

   
   
   
   
   
   
   
   
   
   
   
   
   
     
     
     
     
     
     
     
     


Conclusion

This covers what is necessary to perform the automated build and deployment of a simple Tibco project.