Created
June 22, 2018 02:55
-
-
Save xcaptain/811d57e38a3681a457e55ff0dfdf1329 to your computer and use it in GitHub Desktop.
用rsync的方式配置deployer实现代码部署
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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