asticode / php-deployment-manager
部署管理器,在Git推送后可自动在您的服务器上部署PHP或GO项目
v0.0.1
2015-09-28 20:08 UTC
Requires
- php: >=5.3.0
- ext-pdo_mysql: *
- asticode/php-data-mapper: dev-master
- asticode/php-file-manager: dev-master
- asticode/php-toolbox: dev-master
- aura/sql: ~2.4.0
- monolog/monolog: 1.*
- symfony/console: ^2.7
This package is not auto-updated.
Last update: 2024-09-14 18:20:29 UTC
README
您必须事先创建一个UTF-8数据库和一个具有读写权限的用户
安装
使用以下命令安装项目
$ composer create-project asticode/php-deployment-manager <your path>
并按照屏幕上的说明进行操作
$ To install the manager, you need a valid UTF-8 database as well as a user with read/write privileges on it. Once you have it, please fill in the information below:
$
$ database host [localhost]:
$ database name [deployment]:
$ database user name:
$ database user password:
$ number of backups kept per project [2]:
$ full path to composer binary [/usr/local/bin/composer]:
$ full path to git binary [/usr/bin/git]:
$ full path to php binary [/usr/bin/php]:
$
$ Update local config parameters: OK
$
$ Execute SQL commands: OK
$
$ Create directories: OK
$
$
$ Installation successful!
如果出现问题,请删除由composer创建的文件夹,然后重新运行命令。
工作原理
部署管理器以相同的方式构建所有项目
1. Back up the current project content
2. Create a temp directory
3. Fetch the last version of the project in the temp directory
4. Execute the specific steps of the build handler associated with the project
5. Move the temp dir to the real project dir
因此,几乎所有的内容都取决于您选择的构建处理程序,因为它将决定在获取项目的最后一个版本后采取的具体步骤。
项目附带了一个现成的构建处理程序:PHP处理程序。它的具体步骤是
1. Copy the dist config files
2. Replace the dist parameters
添加自定义构建处理程序
但是,如果您想执行不同的步骤怎么办呢?
这很简单!您只需在/src/Service/Build/Handler/Custom文件夹中创建自己的构建处理程序,并实现HandlerInterface,特别是实现一个getSpecificSteps方法,该方法将返回您在部署期间想要执行的步骤。
完成后,只需通过将Custom\\MyAwesomeHandler
赋予项目属性handler
来将其与您的项目关联。
创建新项目
使用以下命令添加新项目
$ <your path>/app/console project:add
删除项目
使用以下命令删除项目
$ <your path>/app/console project:remove -n <project name> -b <branch name>