Preparing the Application Package Using the Deployment Tool

The following procedures explain how to create the application package (.zpk), which contains the data, scripts, and an XML descriptor file for your application.

What is the application package?

How do I deploy the application package?

Note:

The deployment feature, including virtual host management, is only available for Zend Server running on Apache or nginx Web servers.

Creating the Package

Zend's Deployment Tool allows you to create a skeleton package, and pack the contents into a .zpk package. For more information on the tool, see Zend Deployment Tool.

 

 

Instructions on how to complete a procedure

To create the package skeleton:

  1. Select a directory, and use the create command to create the skeleton of your .zpk package. This includes the XML descriptor file, the data folder and the hook scripts (templates):

  • Linux: '<install_dir>/bin/zdpack create <application-name>'
  • Windows: zdpack.exe create <application-name> where <application-name> is your application's name
  1. Go to the directory to see that the resources have been created:
  • Data folder - The folder that will contain your application files.
  • Scripts folder - The hook script skeletons available for you to edit as needed, and existing monitoring and caching rules (For more information, see Understanding the Package Structure).

  • deployment.xml file - The template of the XML descriptor for you to edit as needed.
  1. Perform the following actions:

    1. Place your application files in the data folder.

    2. Edit the hook scripts according to your needs. You can select from a list of available hook script constants to insert in the scripts.

      Tip!

      To deploy an application with pre-defined and customized monitoring and caching rules, first export your configurations, and edit the included 'pagecache_rules.xml' and 'monitor_rules.xml' files. After you have finished, insert these files in the Scripts folder of your .zpk package.

    3. Edit the XML file as needed. The XML template is made up of example elements. The required elements are name, version and appdir. For more information see the The XML Descriptor File.  

    4. Validate the package by using the validate command :

    • Linux: '<install_dir>/bin/zdpack validate [--schema=<xsd-file>] <package-xml-descriptor-file>'
    • Windows: 'zdpack.exe validate [--schema=<xsd-file>] <package-xml-descriptor-file>'

      Note:

      The XSD file is located at: <install_dir>/share/deployment.xsd

  2. Use the pack command to pack the contents into a .zpk package. By default, the Deployment Tool will create the package in the working directory:

  • Linux: '<install_dir>/bin/zdpack pack <application-name>'
  • Windows: 'zdpack.exe pack <application-name>'

Once you have a .zpk application package ready and packed, you can deploy your application or update an existing application.

Zend Deployment Tool

 The Deployment Tool usage includes the following:

  • Tool location - The tool is located in:
    • Linux - '/usr/local/zend/bin/zdpack'
    • Windows - 'C:Program Files\Zend\ZendServer\bin\zdpack'
  • Usage - Run the help command from the bin directory to see the usage:

    • Linux: '<install_dir>/bin/zdpack --help'
    • Windows: 'zdpack.exe --help')

Command Line Actions

Action

Description

create <application-name>

Create a skeleton for new application

validate [--schema=<xsd-file>] <package-xml-descriptor-file>

Validate a given Zend package descriptor against the schema file

pack

Create a package. The pack options should contain pointers to the application data directory, the package descriptor file, and the package scripts directory.

Command Line Options

Option

Description

package-directory

A directory containing the data and the script directories, in addition to the package descriptor file.

--src-dir=directory

The directory that contains the application resources (PHP sources, JavaScript, etc.). The directory's internal structure must match the necessary structure for the application to be functional.

--scripts-dir=directory

The directory which contains the package deployment scripts. The Deployment Tool will search this directory for the expected files (as described in section 2.2.1) and then packs them.

--package-descriptor=xml-file

The package descriptor file.

--output-dir=directory

The directory in which the package is created. The package name will be created as "<app-name>-<app-version>.zpk".

--php-exe=php-executable

The PHP executable to use for lint.

--lint

Performs a PHP lint test on the deployment scripts before creating the package.

--help

Displays the tool's usage.

--schema=xsd-file

The path to the package descriptor schema used for validation.