Project-v10.xml

From ControlTier

(Redirected from Project.xml)
Jump to: navigation, search


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.

nested elements
elementdescription
#nodenode resource
#settingsetting resource
#packagepackage resource
#deploymentdeployment 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.

attributedescriptionexample value
typenode typeNode
namenode namea name
descriptionnode descriptiona character string
hostnameThe 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 requireda valid hostname
osArchoperating system architecture(eg uname -p)
osFamilyoperating system familywindows or unix
osNameoperating system name(eg uname -s)
osVersionoperating system version(eg uname -r)
ctlBaseCTL framework instance directoryCT_BASE
ctlHomeCTL software installation root directoryCTL_HOME
ctlUsernameThe username on the remote host to which you are connecting.(eg ${framework.ssh.user}
ctlPasswordremote connection passwordUnceccessary when using key-based authentication
tagsFiltering tags

nested elements
elementdescription
#resourcesChild dependencies
#referrersParent 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.

attributes
attributedescriptionvalues
typesetting typeSetting type
namesetting namea name
descriptionsetting descriptiona character string
settingTypethe value typea string
settingValuethe setting valuea string

nested elements
elementdescription
#referrersParent 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

nested elements
elementdescription
#resourcesChild dependencies
#referrersParent 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.

attributes
attributedescriptionvalues
typedeployment typeDeployment type
namedeployment namea name
descriptiondeployment descriptiona character string
basedirthe base directorya path
installRootthe install directorya path
startuprankthe startup ranka string

nested elements
elementdescription
#resourcesChild dependencies
#referrersParent dependencies
#transformsParent 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.

attributes
attributedescriptionvalues
typeresource typea type
nameresource namea 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.

attributes
attributedescriptionvalues
replacewhether or not to replace child resource relationships that already exist in the projecttrue or false
nested elements
attributedescription
#resourceA 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.

nested elements
attributedescription
#resourceA parent resource

Example

<referrers>
  <resource name="centos" type="Node" />
  <resource name="development" type="Node" />
</referrers>


transform

A document transform. A transform element is used to specify the attributes of a document associated with the deployment (see the TransformCreate Task Reference)

attributes
attributedescriptiondefault
nametransform name
descriptiondescription of the document transform
filetypethe document's file typetext/plain
outputdiroutput directory of the transformed document${resource.deployment-basedir}
templatetemplate file used to drive the transformsame as the transform name
templatetypethe template file type simple
templatedirthe directory containing the template file${modules.dir}/type/templates
directionthe direction in which attributes are brought into scope of the transformation internal
proximitythe 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

The transforms tag defines a set of document transforms associated with a deployment. Each individual document transform is referenced via a #transform element.

nested elements
attributedescription
#transformA document transform

Example

<transforms replace="true">
  <transform name="server.xml"  description="Tomcat server configuration file" 
      outputdir="${resource.deployment-basedir}/conf"/>
</transforms>
Personal tools
Namespaces
Variants
Actions
Navigation
Communication
Development
Toolbox
Print/export