Project-v10.xml
From ControlTier
The 'project' XML document declares a resource model that can also be uploaded to a project hosted on the ControlTier server.
This is a demonstration document using all possible elements in the current DTD, project.dtd.
This file can be batch loaded via ProjectBuilder load-resources:
ctl -m ProjectBuilder -c load-resources -- -file /path/to/resources.xml
The resource model can be dumped and saved to a file via find-resources
ctl -m ProjectBuilder -c find-resources -- -out /tmp/resources.xml
Once loaded, the data is merged into the existing project's model.
Contents |
project
The root (aka "top-level") element of the project.xml file. Contains a set of resource elements. There is an explict ordering of subsequent resource definitions.
| element | description |
|---|---|
| #node | node resource |
| #setting | setting resource |
| #package | package resource |
| #deployment | deployment resource |
Example
<!DOCTYPE project PUBLIC "-//ControlTier Software Inc.//DTD Project Document 1.0//EN" "project.dtd"> <project> <node .../> <setting ... /> <package ... /> <deployment ... /> </project>
node
The node element defines a Node resource.
| attribute | description | example value |
|---|---|---|
| type | node type | Node |
| name | node name | a name |
| description | node description | a character string |
| hostname | The hostname or IP address of the remote host to which you wish to connect. Can include port (eg hostname:port) if non-standard SSH port is required | a valid hostname |
| osArch | operating system architecture | (eg uname -p) |
| osFamily | operating system family | windows or unix |
| osName | operating system name | (eg uname -s) |
| osVersion | operating system version | (eg uname -r) |
| ctlBase | CTL framework instance directory | CT_BASE |
| ctlHome | CTL software installation root directory | CTL_HOME |
| ctlUsername | The username on the remote host to which you are connecting. | (eg ${framework.ssh.user} |
| ctlPassword | remote connection password | Unceccessary when using key-based authentication |
| tags | Filtering tags |
| As of 3.4.10 it is possible to omit the ctlPassword attribute (along with all the other attributes set automatically by ctl-project, or updated via Workbench) and expect the set (or unset) value to be preserved. Prior to that release, the value would be corrupted with a property name if the attribute wasn't explicitly provided. |
| element | description |
|---|---|
| #resources | Child dependencies |
| #referrers | Parent dependencies |
Examples
Define a node named "strongbad":
<node name="strongbad" type="Node" description="a development host" hostname="strongbad.local" osArch="i386" osFamily="unix" osName="Darwin" osVersion="9.2.2" ctlBase="/ctier/ctl" ctlHome="/ctier/pkgs/ctl-1.1" ctlUsername="${framework.ssh.user}"/>
Define an instance of the type LinuxNode that has a ApacheSystemService as a resource:
<node type="LinuxNode" name="sample" description="Sample Linux node" tags="sample,linux"> <resources replace="true"> <resource type="ApacheSystemService" name="sample"/> </resources> </node>
Define a node named that uses a non standard SSH port. The "hostname" value is overloaded to include the port (centos:4022):
<node name="centos54" type="Node" description="a centos host" hostname="centos:4022" ctlBase="/ctier/ctl" ctlHome="/ctier/pkgs/ctl-1.1" ctlUsername="deploy"/>
setting
The setting element defines a Setting resource.
| attribute | description | values |
|---|---|---|
| type | setting type | Setting type |
| name | setting name | a name |
| description | setting description | a character string |
| settingType | the value type | a string |
| settingValue | the setting value | a string |
| element | description |
|---|---|
| #referrers | Parent dependencies |
Example
<setting type="PackageFinishScript" name="apache-tomcat-5.5.26.zip" description="The script used during prepare" settingValue="$HOME/bin/tomcat-finish.sh" settingType="script"/>
package
The package element defines a Package resource.
| attribute | description |
|---|---|
| arch | Hardware architecture. |
| base* | Package base. |
| buildtime | Build identifier |
| description | Description of the package. |
| filename* | Name of the file. |
| filetype | Archive format. |
| installroot* | Directory where archive will be extracted. |
| installrank* | Relative ordering. |
| name* | Name of the package. Usually, the same as filename |
| release | Version release. |
| releasetag | Release identifier. |
| repoUrl* | URL to the file in the repository. |
| restart | Signifies if the service should restart after installation. |
| type | Name of Package type or subtype |
| vendor | Organization that created the package |
| version* | Package version |
| element | description |
|---|---|
| #resources | Child dependencies |
| #referrers | Parent dependencies |
Example
<package arch="noarch" base="apache-tomcat-5.5.26" buildtime="2008061570109" description="The Tomcat application server." filename="apache-tomcat-5.5.26.zip" filetype="zip" installroot="/demo/apache-tomcat-5.5.26" installrank="" name="apache-tomcat-5.5.26.zip" release="" releasetag="" repoUrl="${framework.pkgRepo.upload-url}/default/zip/zips/apache-tomcat-5.5.26.zip" restart="false" type="zip" vendor="" version="5.5.26" />
Another example showing resources:
<!-- ** ** Defines path to the prepare and finish scripts ** --> <setting type="PackagePrepareScript" name="apache-tomcat-5.5.26.zip" description="The script used during finish" settingValue="$HOME/bin/tomcat-prepare.sh" settingType="script"/> <setting type="PackageFinishScript" name="apache-tomcat-5.5.26.zip" description="The script used during prepare" settingValue="$HOME/bin/tomcat-finish.sh" settingType="script"/> <!-- ** ** Defines package resource ** --> <package arch="noarch" base="apache-tomcat-5.5.26" buildtime="2008061570109" description="The Tomcat application server." filename="apache-tomcat-5.5.26.zip" filetype="zip" installroot="/demo/apache-tomcat-5.5.26" installrank="" name="apache-tomcat-5.5.26.zip" release="" releasetag="" repoUrl="${framework.pkgRepo.upload-url}/default/zip/zips/apache-tomcat-5.5.26.zip" restart="false" type="zip" vendor="" version="5.5.26" > <!-- ** ** References the prepare and finish scripts as dependencies to the package ** --> <resources replace="true"> <resource type="PackagePrepareScript" name="apache-tomcat-5.5.26.zip"/> <resource type="PackageFinishScript" name="apache-tomcat-5.5.26.zip"/> </resources> </package>
deployment
The deployment element defines a Deployment (or subtype) resource.
| attribute | description | values |
|---|---|---|
| type | deployment type | Deployment type |
| name | deployment name | a name |
| description | deployment description | a character string |
| basedir | the base directory | a path |
| installRoot | the install directory | a path |
| startuprank | the startup rank | a string |
| element | description |
|---|---|
| #resources | Child dependencies |
| #referrers | Parent dependencies |
| #transforms | Parent dependencies (Since 3.4.10) |
Example
<deployment type="Deployment" name="tomcat1" description="The Tomcat deployment." installRoot="/demo/apache-tomcat-5.5.26" basedir="/demo/apache-tomcat-5.5.26" />
Another example showing resources and referrers:
<deployment type="Deployment" name="tomcat1" description="The Tomcat deployment." installRoot="/demo/apache-tomcat-5.5.26" basedir="/demo/apache-tomcat-5.5.26"> <resources replace="true"> <resource name="apache-tomcat-5.5.26.zip" type="zip" /> <resource name="extras.jar" type="jar" /> </resources> <referrers replace="true"> <resource name="centos" type="Node" /> <resource name="development" type="Node" /> </referrers> </deployment>
resource
A Resource instance. A resource element is used to reference another resource in the project model by type and name.
| attribute | description | values |
|---|---|---|
| type | resource type | a type |
| name | resource name | a name |
Example
Refrences an instance of Deployment named "tomcat1".
<resource type="Deployment" name="tomcat1" />resources
The resources tag defines a set of child resource relationships. Each child resource is referenced via a #resource element.
| attribute | description | values |
|---|---|---|
| replace | whether or not to replace child resource relationships that already exist in the project | true or false |
| attribute | description |
|---|---|
| #resource | A child resource |
Example
<resources replace="true"> <resource name="apache-tomcat-5.5.26.zip" type="zip" /> <resource name="extras.jar" type="jar" /> </resources>
referrers
The referrers tag defines a set of parent resource relationships. Each parent resource is specified via a #resource element.
| attribute | description |
|---|---|
| #resource | A parent resource |
Example
<referrers> <resource name="centos" type="Node" /> <resource name="development" type="Node" /> </referrers>
transform
| This element is only available in releases after ControlTier 3.4.9 |
A document transform. A transform element is used to specify the attributes of a document associated with the deployment (see the TransformCreate Task Reference)
| attribute | description | default |
|---|---|---|
| name | transform name | |
| description | description of the document transform | |
| filetype | the document's file type | text/plain |
| outputdir | output directory of the transformed document | ${resource.deployment-basedir} |
| template | template file used to drive the transform | same as the transform name |
| templatetype | the template file type | simple |
| templatedir | the directory containing the template file | ${modules.dir}/type/templates |
| direction | the direction in which attributes are brought into scope of the transformation | internal |
| proximity | the extent to which attributes are brought into scope of the transformation | 1 |
Example
Defines the Tomcat server configuration file as a transformed document:
<transform name="server.xml" description="Tomcat server configuration file" filetype="text/plain" outputdir="${resource.deployment-basedir}/conf" template="server.xml" templatetype="simple" templatedir="${modules.dir}/Deployment/templates" direction="internal" proximity="1"/>
transforms
| This element is only available in releases after 3.4.9 |
The transforms tag defines a set of document transforms associated with a deployment. Each individual document transform is referenced via a #transform element.
| attribute | description |
|---|---|
| #transform | A document transform |
Example
<transforms replace="true"> <transform name="server.xml" description="Tomcat server configuration file" outputdir="${resource.deployment-basedir}/conf"/> </transforms>
| ||||||||||||||