PHPDeploy is a command line application written completely in PHP language. Its purpose is to make deploy of a web application as easy and fast as possible. It's meant to be executed directly on the server and it uses local copy of your code repository. PHPDeploy is based on Symfony 2 components and it's very flexible and extensible. Most of the builtin features are separated into independent plugins and new plugins can be easily created.
Table of Contents
PHPDeploy is dependent only on php, git and curl so using this tool is very convenient and there is probably no need to install anything you already don't have on your server.
SSH to your server, clone this repository, install 3rd party libraries with Composer, enable necessary plugins and fill config file.
$ git clone https://github.com/Pajk/PHPDeploy.git myappdeploy $ cd myappdeploy $ ./init.sh $ vim config/plugins.php $ vim config/config.php $ ./run init -vv $ ./run deploy -vv
plugins.php
file contains a list of enabled plugins. Beware that it's an ordered list, plugins are registered in stated sequence and also defined event listeners are registered in this order.
Every plugin has it's own set of options you can use in your config.php
, you can find them all in this documentation or take a look directly to the code.
Now when you have all set up and configured, you have to initialize your deployment by running ./run init
. Then you can deploy a version of your application by running ./run deploy
. Symlink current
then link to latest deployed release.
PHPDeploy contains only one runnable script which is called run
. With this script you can run init, deploy and rollback commands.
Create a target deploy directory and initialize directory structure - folders releases
and logs
. Also cached-copy
and shared
if you have enabled builtin plugins Git and Shared. It creates a local copy of your repository and also create all shared directories and files.
Please see INIT.rst for more details.
Fetches last changes from remote repository and export code to new directory in releases
folder. After all plugins are done (eg. composer installs 3rd party dependencies, shared files are symlinked, Phinx database migrations are migrated) the current
symlink is created and it links to the deployed release. Every action is logged to a log file and after deploy is finished, this log is stored in logs
directory.
Please see DEPLOY.rst for more details.
Finds second last deployed release and returns to this release. When database migrations are enabled it also rollbacks your database to previous state (assuming that your migrations are reversible).
Please see ROLLBACK.rst for more details.
This is a list of all built-in plugins. Every plugin has a set of options which you can change in config/config.php
file. Most of them have reasonable defaults but you can change them to satisfy your needs.
Please see PLUGIN_HOWTO.rst for more details.
Thanks to these great tools and applications. PHPDeploy wouldn't exist without them.
Capistrano, Phing, Phingistrano, Git, Composer, Symfony Components (Config, Console, Dependency Injection, Event Dispatcher, Filesystem Process), Monolog, Phinx
PHPDeploy is released under the MIT License, please see LICENSE.