|
ManagingApplications
Managing Applications from the Command Line
Managing Applications from the Command LineThe main operations provided by Zend SDK are related to application management. It uses Zend WebAPI to expose the following operations:
Additionally, it also allows to create deployment package. The Zend SDK tool lets you manage applications on the command line. For a complete reference of the command line options that you can use, see the Command Line Tool Reference. Deploying an ApplicationZend SDK allows to deploy a new application to the server or cluster. This process is asynchronous – the initial request will wait until the application is uploaded and verified, and the initial response will show information about the application being deployed – however the staging and activation process will proceed after the response is returned. The user may continue checking the application status using the list applications command until the deployment process is complete. There are three possible sources of the application which should be deployed. For each of them there are some dedicated options. The common options are described below this section. Local project or zpk package
zend deploy application [-p </path/to/project-or-package>] [-b <base-path>]
-t <target-id> [-m </path/to/properties/file>] [-n <app-name>] [-f] [-h <host-name>]
where:
Git repository
zend deploy application -r <repository> [-b <branch>] [-u <user>] [-p <password>] [-k <key>] [-b <base-path>]
[-t <target-id>] [-m </path/to/properties/file>] [-n <app-name>] [-f] [-h <host-name>]
where:
Zend Repository
zend deploy application -z <zend-repository> -i <application-id> [-b <base-path>]
-t <target-id> [-m </path/to/properties/file>] [-n <app-name>] [-f] [-h <host-name>]
where:
The following options are common for all application sources:
Updating an ApplicationZend SDK allows to update an existing application. The package or project provided must be the same application as the one with specifed id. Additionally any new parameters or new values to existing parameters must be provided. This process is asynchronous – the initial request will wait until the package is uploaded and verified, and the initial response will show information about the new version being deployed – however the staging and activation process will proceed after the response is returned. The user may continue checking the application status using the list applications command until the updating process is complete. There are three possible sources of the application which should be updated. For each of them there are some dedicated options. The common options are described below this section. Local project or zpk package
zend update application [-p </path/to/project-or-package>] -a <app-id> [-t <target-id>]
[-m </path/to/properties/file>] [-n <app-name>] [-f]
where:
Git repository
zend update application -r <repository> [-b <branch>] [-u <user>] [-p <password>] [-k <key>]
-a <app-id> [-t <target-id>] [-m </path/to/properties/file>] [-n <app-name>] [-f]
where:
Zend Repository
zend update application -z <zend-repository> -i <application-id> -a <app-id> [-t <target-id>]
[-m </path/to/properties/file>] [-n <app-name>] [-f]
where:
The following options are common for all application sources:
Removing an ApplicationZend SDK allows to remove/undeploy an existing application. This process is asynchronous – the initial request will start the removal process and the initial response will show information about the application being removed – however the removal process will proceed after the response is returned. The user is expected to continue checking the application status using the list applications command until the removing process is complete. Once the result of list applications will not consist this applications it means that it was removed completely. To remove application, use this command: zend remove application -a <app-id> [-t <target-id>] This command line removes application with id equals to app-id from the target-id. Redeploying an ApplicationZend SDK allows to redeploy an existing application, whether in order to fix a problem or to reset an installation. This process is asynchronous – the initial request will start the redeploy process and the initial response will show information about the application being redeployed – however the redeployment process will proceed after the response is returned. The user may continue checking the application status using the list applications command until the redeploying process is complete. To redeploy application, use this command: zend redeploy application -a <app-id> [-t <target-id>] [-s <server-names>] [-i] The following options are required:
Additionally, there are the following optional options:
Listing ApplicationsZend SDK allows to get the list of applications currently deployed (or staged) on the server or the cluster and information about each application. If application IDs are specified, will return information about the specified applications. If no IDs are specified, will return information about all applications in the specified target. To redeploy application, use this command: zend list applications [-a <app-id>] [-t <target-id>] The following options are available:
Creating a PackageZend SDK allows to create zpk application package. The default package structure consists following files:
Package creation process uses deployment.properites (for more details, see DeploymentPropertiesFile). If this file is not defined, then default rules are used:
To create package, use this command: zend create package [-p </path/to/project>] [-d <destination>] The flag -p should have as an argument path to the project root directory. -d is optional and allows to change the location where package will be created (by default it will be created in the current location). Push an ApplicationZend SDK allows to push all local changes to remote git repository. It performs following operations:
zend push application [-a </path/to/project>] [-r <remote_name>] [-m <commit_message>]
[-a <author_name:author_email>] [-u <user>] [-p <password>] [-k <key>]
The flag -a is not required if the current location is a root application folder. By default, remote name is "phpcloud". Commit message provided by -m option is used for all commits to local repository performed during pushing process. If it is not specified, default value is used. | |