mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-23 16:54:08 +01:00
* Fix check_remote task * Check remote head contents locally * Ensure .dep/HEAD file is available so error isn’t thrown * Document task usage Fixes #1990 * Fix Silverstripe recipe * Additionally check shared directory for assets since this directory is commonly excluded from project git repos * Ensure shared_assets returns a non-null value so the release folder can’t get accidentally deleted Fixes #1989 * Update CHANGELOG.md * Clarified contribution instructions * Update issue templates Added a bug report template
72 lines
1.5 KiB
PHP
72 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace Deployer;
|
|
|
|
require_once __DIR__ . '/common.php';
|
|
|
|
/**
|
|
* Silverstripe configuration
|
|
*/
|
|
|
|
set('shared_assets', function () {
|
|
if (test('[ -d {{release_path}}/public ]') || test('[ -d {{deploy_path}}/shared/public ]')) {
|
|
return 'public/assets';
|
|
}
|
|
return 'assets';
|
|
});
|
|
|
|
|
|
// Silverstripe shared dirs
|
|
set('shared_dirs', [
|
|
'{{shared_assets}}'
|
|
]);
|
|
|
|
// Silverstripe writable dirs
|
|
set('writable_dirs', [
|
|
'{{shared_assets}}'
|
|
]);
|
|
|
|
// Silverstripe cli script
|
|
set('silverstripe_cli_script', function () {
|
|
$paths = [
|
|
'framework/cli-script.php',
|
|
'vendor/silverstripe/framework/cli-script.php'
|
|
];
|
|
foreach ($paths as $path) {
|
|
if (test('[ -f {{release_path}}/'.$path.' ]')) {
|
|
return $path;
|
|
}
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Helper tasks
|
|
*/
|
|
task('silverstripe:build', function () {
|
|
return run('{{bin/php}} {{release_path}}/{{silverstripe_cli_script}} /dev/build');
|
|
})->desc('Run /dev/build');
|
|
|
|
task('silverstripe:buildflush', function () {
|
|
return run('{{bin/php}} {{release_path}}/{{silverstripe_cli_script}} /dev/build flush=all');
|
|
})->desc('Run /dev/build?flush=all');
|
|
|
|
/**
|
|
* Main task
|
|
*/
|
|
task('deploy', [
|
|
'deploy:info',
|
|
'deploy:prepare',
|
|
'deploy:lock',
|
|
'deploy:release',
|
|
'deploy:update_code',
|
|
'deploy:vendors',
|
|
'deploy:shared',
|
|
'deploy:writable',
|
|
'silverstripe:buildflush',
|
|
'deploy:symlink',
|
|
'deploy:unlock',
|
|
'cleanup',
|
|
])->desc('Deploy your project');
|
|
|
|
after('deploy', 'success');
|