|
ManagingProjects
Managing Projects from the Command Line
Managing Projects from the Command LineThe default deployable project has to have two files which are required:
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 ProjectZend 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):
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 ProjectZend 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:
Clone ProjectZend 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:
Add RemoteZend 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". | |