Friday, March 02, 2012

Using Ant Script to Deploy the project to OSB Console

Using Ant Script to Deploy the project to OSB Console

Extract the IMPORT-EXPORT. zip file into your local machine.
It will contain the following files.



Export.py and Import.py are the python script written to export and import the files respectively from osb console
Import.properties and Export.properties are the property file that we need to change in order to point it to our local server.
In order to test the import (deploy to osb console)scenario with the given project.a
I made the following changes in my import.properties file.
Adminurl-Changed it to my local host
importUser-My osb username
importPassword-My osb password


Now open a command console.
Set your JAVA_HOME=C:\OSB\jdk160_18
Set your BEA_HOME=C:\OSB
Set your ANT_HOME=C:\OSB\modules\org.apache.ant_1.7.1

Navigate till the folder location where we have build.xml file.
Run the setDomainEnv.cmd to set the properties value.
C:\OSB\user_projects\domains\base_domain\bin\setDomainEnv.cmd
Now run the following command ant import
This will import your code in to the osb console.



Now log into your osb console and verify if the process is there or not.



Since in the import.properties file I have specified the project as default my code is deployed in the same project folder.
=================================================================================

Now in order to check this using customization file. I am having an extracted jar file(sbconfig.jar) and a customization file(ALSBCustomization.xml)- ExportedFile.zip
Now in order to test if customization is working fine or not first import the project without using customization file. In order to do that copy the sbconfig.jar in your directory where you have all other files and change your import.properties as follows



Here notice that I have commented the project ,pass phrase and CustomizationFile option.

Now go to the command console again and do an ant import


It will import the new project in to the console.
Go to the osb console and verify if the new project is created or not.



Now expand the service go to any of the business service and test it.
You will get an error like this.

This is because we have not used customization file to change the port address.
Since my server is running on 7001 port and this project is by default using 7021 as the port to call.
Now delete this project and we will try to redeploy it to the osb console using customization file.
Now copy the customization file ALSBCustomization.xml in to the same folder where you have build.xml
And rename it as OSBCustomizationFile.xml
Now go to the import.properties file and include the customization file as shown below.


This customization file contains the changed port for the osb service.
Now again go to command console and do ant import
Make sure the customization file is loaded.



Now again go back to you osb console and test the business service.
This time you should be able to test the business service.




===================================================================================

No comments: