Setting up a Package for import

From ControlTier

Jump to: navigation, search
See a short screencast

This document describes how to store packages in the ControlTier repository. ControlTier provides a set of package control modules, any of which can be used to manage the creation and installation life cycle for your packaging artifacts:

Each of these control modules can create and extract the packaged files of its archive format. You can also override the behavior of any of the life cycle steps through subtyping. If you have an archive format or set of life cycle steps that is not covered by one of these, then subtype the Package control module but be sure to implement the create and extract commands.

Uploading an existing file as a package

You can store an existing file as a package in the repository. This is done in two steps:

1. Define the package metdata file

Create a project.xml file similar to the example below. This example represents the zip distribution of Apache Tomcat 5.5 downloaded from here: http://tomcat.apache.org/download-55.cgi. For this example, imagine the file was downloaded as /tmp/apache-tomcat-5.5.26.zip and an XML file called /tmp/package.xml contains the package metadata:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project PUBLIC "-//ControlTier Software Inc.//DTD Project Document 1.0//EN" 
    "project.dtd">
<project>
  <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="${resource.deployment-basedir}" 
      installrank="" 
      name="apache-tomcat-5.5.26.zip" 
      release=""
      releasetag=""
      repoUrl="/zip/zips/apache-tomcat-5.5.26.zip" 
      restart="false"
      type="zip"
      vendor=""
      version="5.5.26"      
      />
</project>

Of course, for your metadata file you will change the details from the one in the example. The table below gives a brief description for each of the attributes in the package metdata file. The ones with an asterisk are required during the deployment cycle.

attributedescription
archHardware architecture.
base*Package base.
buildtimeBuild identifier
descriptionDescription of the package.
filename*Name of the file.
filetypeArchive format..
installroot*Directory where archive will be extracted.
installrank*Relative ordering.
name*Name of the package. Usually, the same as filename
releaseVersion release.
releasetagRelease identifier.
repoUrl*URL to the file in the repository.
restartSignifies if the service should restart after installation.
typeName of control module
vendorOrganization that created the package
version*Package version


2. Upload the file to the repository

The next step is to upload the file to the repository using the metadata defined in the xml file above.

ctl -p demo -m zip -c upload -- \
   -xml /tmp/package.xml
   -filename /tmp/apache-tomcat-5.5.26.zip

Output from the upload should resemble the text below:

Uploading to: http://strongbad:8080/webdav/pkgs/demo/zip/zips/apache-tomcat-5.5.26.zip
Uploading: apache-tomcat-5.5.26.zip
Puted 1 file to http://strongbad:8080/webdav/pkgs/demo/zip/zips/apache-tomcat-5.5.26.zip
Loading metadata from XML file: '/tmp/package.xml' ...
Loading "/tmp/package.xml" ...
1 file(s) have been successfully validated.
Mapping XML to properties ...
Collecting object attributes ...
Batching object attribute updates ...
Batching resource and referrer updates ...
Executing batch update ...

After the package has been registered you can query the repository and now see it listed:

	$ ctl -p demo -m ProjectBuilder -c find-resources -- -type zip
	|
	|--(zip) apache-tomcat-5.5.26.zip

Alternatively, you can go to the PackageManager in Workbench and view it there. Go to Workbench → PackageManager → Package List. You will see it listed as a zip package.

Personal tools
Namespaces
Variants
Actions
Navigation
Communication
Development
Toolbox
Print/export