<?php
namespace Deployer;
//require 'recipe/yii2-app-advanced.php';
// Project name
set('application', 'project');
// Hosts
localhost()
->stage('dev')
->set('deploy_path', '/var/www/public/example.com');
// Project repository
set('repository', 'git@xxxxx:xxxxx.git');
// Tasks
task('deploy:git', function () {
run('cd /var/www/public/example.com && git pull');
});
task('deploy:migration', function () {
run('cd /var/www/public/example.com && php yii migrate');
});
task('deploy:composer', function () {
run('cd /var/www/public/example.com && composer install');
});
task('deploy:npm', function () {
run('cd /var/www/public/example.com/client-apps && npm install');
});
task('deploy:ng build', function () {
run('cd /var/www/public/example.com/client-apps && ng build --prod');
});
task('deploy', [
'deploy:git',
'deploy:migration',
'deploy:composer',
'deploy:npm',
'deploy:ng build',
]);
// [Optional] if deploy fails automatically unlock.
//after('deploy:failed', 'deploy:unlock');
?>
Спрашивайте конкретику. У вас очень пространный вопрос, на который невозможно нормально ответить.
The command "rm -f /var/www/public/education.vm/.dep/deploy.lock" failed
<?php
namespace Deployer;
require 'recipe/yii2-app-advanced.php';
// Project name
set('application', 'my_project');
// Project repository
set('repository', 'git@xxxxxxxxxxxx.git');
set('use_relative_symlinks', false);
// Shared files/dirs between deploys
add('shared_files', []);
add('shared_dirs', []);
// Writable dirs by web server
add('writable_dirs', []);
// Hosts
host('127.0.0.1', 2022)
->set('deploy_path', '/var/www/public/education.vm');
// Tasks
task('build', function () {
run('cd /var/www/public/education.vm/client-apps && ng build --prod');
});
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');