6.2 Generating Deployment Files
6.2.1 Concepts
|
After modelling and building, the next step is to create the deployments.
GigaSystemBuilder creates an intermediate XML file, by default called 'generatedDeployment.xml'.
(If you want to change this name, change the property in the file
jeewiz/resources/giga-spaces/control/application/component.properties, then re-build the application.)
It can be found at the top project level, at the same level as the .osm model).
This is used to generate the actual deployment scripts.
This file contains a root node for the <application>,
then a nested <deploymentOption> element for each named Deployment.
Then, for PU in the build, there is a <deploymentOption> element for each processing unit.
Just to give you an idea, this extract shows the structure:
<application name="TheApplication"
deploymentKey="TheApplication_key"
>
<deploymentOption name="deployment1"
target="CommandLine"
machines="Inspiron510m,NteDell8"
>
<processingUnit name="UtilityPU"
projectName="TheApplication_UtilityPU"
|
6.2.2 ChangingTheDeployment
|
We expect most development teams to change the deployment scripts. There are two ways of doing this.
- Amend the GigaSystemBuilder scripts.
The Velocity scripts for this are in the following directory:
<EclipseDir>/plugins/com.nte.gigasystembuilder.builder_x.y.z/
jeewiz/resources/control/giga-spaces-deployment/application
|
You should copy the files you want to change to your own directory,
then preserve the remainder of the filename from 'giga-spaces-deployment/application'.
In other words, to change file X, copy it to ...MyDir/giga-spaces-deployment/application/X and change it there.
You will have to go into Windows/Preferences/GigaSystemBuilder in Eclipse and set the
customTemplateDirectoryFromEclipse to be '...MyDir', whatever your root directory is.
You will be using the JeeWiz variant of Velocity for this. See jeewiz.org for more details.
- Use the 'generatedDeployment.xml' file and your own favourite scripting language to write the deployment.
6.2.3 How To
|
To generate the deployment files using the 'generatedDeployment.xml' file
and the GigaSystemBuilder scripts (either out of the box or altered by you),
open a command box, cd to the GigaSpaces project directory and type:
To generate the deployment files using another XML file open a command box and change to the GigaSpaces project directory and type:
ant -DdeploymentDefinition=<the deployment file> -f provisioning.xml
|
Both of these result in the generation of the deployment files. A sub-directory called 'deployment' will be generated in the main project. Further
sub-directories are generated below the 'deployment' directory, one for each named Deployment Option. These sub-directories will be named using the
Deployment Option name. For example if there are 2 Deployment Options - 'deployment1' and 'deployToCloud' - the following directory structure will be
generated.
The contents of the deployment directories will depend on the 'target' of the Deployment Option, which is covered in the remaining sections of this chapter.
|