Skip to content

Instantly share code, notes, and snippets.

@xcaptain
Created June 22, 2018 02:55
Show Gist options
  • Save xcaptain/811d57e38a3681a457e55ff0dfdf1329 to your computer and use it in GitHub Desktop.
Save xcaptain/811d57e38a3681a457e55ff0dfdf1329 to your computer and use it in GitHub Desktop.
用rsync的方式配置deployer实现代码部署
<?php
namespace Deployer;
require 'recipe/rsync.php';
set('rsync', [
'exclude' => [
'.env',
'.git/',
'.gitignore',
'phpunit.xml',
'tests/',
'storage/',
'resources/',
'deploy.php',
'composer.json',
'composer.lock',
'docs/',
],
'exclude-file' => false, //Use absolute path to avoid possible rsync problems
'include' => [],
'include-file' => false,
'filter' => [],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'rzcE', // Recursive, with compress, check based on checksum rather than time/size, preserve Executable flag
'options' => ['delete', 'delete-after', 'force'], //Delete after successful transfer, delete even if deleted dir is not empty
'timeout' => 3600, //for those huge repos or crappy connection
]);
host('web01.prd.bj.tu.wanuq.com')
->set('deploy_path', '/var/www/wca-api')
->set('rsync_src', __DIR__)
->set('rsync_dest', '/var/www/wca-api');
task('deploy', [
'rsync',
])->desc('部署wca-api');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment