My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
ManagingProjects  
Managing Projects from the Command Line
Updated Dec 18, 2011 by wojciech.galanciak

Managing Projects from the Command Line

The default deployable project has to have two files which are required:

  • deployment.xml
  • deployment.properties

First file is a deployment descriptor. For more details, see DeploymentDescriptor.

The second file consists definition of the file mapping. For more details about using deployment.properties file, see DeploymentPropertiesFile.

The Zend SDK tool lets you manage projects on the command line. For a complete reference of the command line options that you can use, see the Command Line Tool Reference.

Creating a Project

Zend SDK allows creating new deployable project which has all required files and a default folder structure. To create new project, use this command:

zend create project -n <name> [-d <path>] [-t <name>] [-s <script names>]

The flag "-d" can be used if the new project should be created in a different location that the current one (as an argument pass the path to the project destination).

The flag "-t" tells the command line tool to create project based on specified template name. Possible arguments are (use only one of the following):

  • simple - simple project structure
  • zend - Zend Application structure
  • quickstart - example Guestbook project
By default (if -t is not used) Zend Application is used as a template.

The flag "-s" tells the command line tool create scripts folder (which is optional and not created by default) with scripts passed as an argument (any of the following names: all|postActivate|postDeactivate|postStage|postUnstage|preActivate|preDeactivate|preStage|preUnstage). All scripts created using this option are empty files with comments how to use them.

Updating a Project

Zend SDK allows also to update an existing project to the proper deployable project. To update an existing project, use this command:

zend update project [-d <path>] [-s <script names>]

By default (command without any option) command line tool treats the current directory as a project root. To specify which application should be updated, use "-d" with a path to the project as an argument (relative to the current location). The flag "-s" has the same behavior as for the project creation (arguments are also the same).

In the result of the project update the following changes are applied:

  • Descriptor file is created. Project root folder is taken as a project name.
  • If "-s" option was used, then scripts folder is created
  • Deployment.properties file is created. By default it maps all files from the project to the appdir directory, except descriptor file, scripts directory and files from the default exclusion list (for more details about it, see DeploymentPropertiesFile).

Clone Project

Zend SDK allows also to clone project from git repository and update it (if necessary) to the proper deployable project. To clone project from git repository, use this command:

zend clone project -r <repository> [-d <destination>] [-b <branch>] [-u <user>] [-p <password>] [-k <key>]

By default (command without any optional parameter) command line tool clones a project from specified repository. If "-d" option is used then project is cloned to the specified destination folder. Otherwise, project root folder is created based on repository name. Clone command support two authentication method, user/password and ssh (for github access). In the case of ssh, "-p" option is applied as a passphrase for a private key. After project is cloned then it is updated (see Updating a Project).

In the result of the project clone the following changes are applied:

  • Repository is cloned to specified location (or to the default one)
  • Descriptor file is created (if it is not available). Project root folder is taken as a project name.
  • If "-s" option was used, then scripts folder is created
  • Deployment.properties file is created (if descriptor is not available). By default it maps all files from the project to the appdir directory, except descriptor file, scripts directory and files from the default exclusion list (for more details about it, see DeploymentPropertiesFile).

Add Remote

Zend SDK allows to add new remote to the existing local git repository.

To add new remote, use this command:

zend add remote -r <repository_url> [-a </path/to/project>]

The flag -a is not required if the current location is a root application folder. New remote name is based on the repository url domain. E.g. for git@github.com:mylogin/testapp.git url new remote will be called "github" and for https://login@login.my.phpcloud.com/git/testapp.git - it will be "phpcloud".


Sign in to add a comment
Powered by Google Project Hosting