PHP code example of nueip / deployer-php-cli
1. Go to this page and download the library: Download nueip/deployer-php-cli library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nueip / deployer-php-cli example snippets
return [
// This project config processes deployment only for simple usage
'default' => [
'servers' => [
'127.0.0.1',
],
'source' => '/home/user/project',
'destination' => '/var/www/html/prod/',
],
];
return [
'default' => [
'tests' => [
[
'name' => 'Test Task 1',
// ...
],
[
'name' => 'Test Task 2',
// ...
],
],
// ...
'source' => '/var/www/html/project',
'destination' => '/var/www/html/test/',
'source' => '/var/www/html/project/',
'destination' => '/var/www/html/test/',
return [
'project1' => [
...
'source' => '/var/www/html/project1',
'destination' => '/var/www/html/',
...
return [
'project1' => [
'user' => [
'local' => 'deployer',
'remote' => 'deployer',
],
...
return [
'project' => [
// ...
'webhook' => [
'enabled' => true,
'provider' => 'gitlab',
'project' => 'nueip/deployer-php-cli',
'token' => 'da39a3ee5e6b4b0d3255bfef95601890afd80709',
'branch' => 'release',
'log' => '/tmp/deployer-webhook-project.log'
],
],
];
[deployer]
user = deployer
group = www-data
listen = /run/php/php7.0-fpm_deployer.sock
'composer' => [
'enabled' => true,
],
'commands' => [
'before' => [
'yii2 init prod' => './init --env=Production --overwrite=All',
],
],
'source' => '/srv/project',
'commands' => [
'before' => [
'Minify inner JS' => [
'command' => 'cd /srv/tools/minify-project; gulp compress',
],
],
],
command
user@stage:/srv$ composer create-project --prefer-dist nueip/deployer-php-cli
command
user@stage:~$ wget https://github.com/nueip/deployer-php-cli/archive/master.tar.gz -O deployer-php-cli.tar.gz
command
user@stage:~$ tar -zxvf deployer-php-cli.tar.gz
command
user@stage:/srv/deployer$ cp ./deployer-php-cli/config.inc.php ./
user@stage:/srv/deployer$ rm -r deployer-php-cli
user@stage:/srv/deployer$ composer create-project --prefer-dist nueip/deployer-php-cli
user@stage:/srv/deployer$ mv ./config.inc.php ./deployer-php-cli
nginx
server_name webhook.your.com;
root /srv/deployer/deployer-php-cli/webhook;
location ~ \.php$ {
sock;
}
command
user@stage:~$ npm install --global --no-optional gulp gulp-uglify-es