PHP code example of nutshell-framework / deployer-recipes

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

    

nutshell-framework / deployer-recipes example snippets




// deploy.php

namespace Deployer;

import(__DIR__.'/vendor/nutshell-framework/deployer-recipes/recipe/project.php');
import('contrib/cachetool.php');

set('rsync_src', __DIR__);

host('DEV')
    ->setHostname('www.example.org')
    ->set('remote_user', 'acme')
    ->set('http_user', 'acme')
    ->set('deploy_path', '/home/www/{{hostname}}')
    ->set('bin/php', 'php8.1')
    ->set('bin/composer', '{{bin/php}} /home/composer.phar')
    ->set('cachetool_args', '--web=SymfonyHttpClient --web-path=./{{public_path}} --web-url=https://{{hostname}}')
;

after('deploy:success', 'cachetool:clear:opcache');

// Project-specific exclude
add('exclude', [
    '.githooks',
]);

// Project-specific tasks
task('yarn:build', function () {
    runLocally('yarn run prod');
});

before('deploy', 'yarn:build');

after('contao:manager:download', 'contao:manager:lock');

host('www.example.org')
    ->set('htaccess_filename', '.htaccess_prod')