PHP code example of yidas / deployer-php-cli

1. Go to this page and download the library: Download yidas/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/ */

    

yidas / 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' => 'yidas/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',
    ],
],

composer create-project --prefer-dist yidas/deployer-php-cli

$ wget https://github.com/yidas/deployer-php-cli/archive/master.tar.gz -O deployer-php-cli.tar.gz

$ tar -zxvf deployer-php-cli.tar.gz

$ cp ./deployer-php-cli/config.inc.php ./
$ rm -r deployer-php-cli
$ composer create-project --prefer-dist yidas/deployer-php-cli
$ mv ./config.inc.php ./deployer-php-cli
nginx
server_name webhook.your.com;
root /srv/deployer/deployer-php-cli/webhook;

location ~ \.php$ {