| Q | A
| ----------------- | ---
| Issue Type | Bug, Question
| Deployer Version | 6.0.3
| Local Machine OS | 7.1.5
| Remote Machine OS | CentOS 7.0
hosts.ymldomain.com.a:
hostname: 192.168.15.91
user: name
port: 22
configFile: ~/.ssh/config
identityFile: ~/.ssh/id_rsa
forwardAgent: true
multiplexing: true
sshOptions:
UserKnownHostsFile: /dev/null
StrictHostKeyChecking: no
stage: production
roles:
- app
- db
deploy_path: ~/app
extra_param: "foo {{hostname}}"
domain.com.b:
hostname: 192.168.15.92
user: name
port: 22
configFile: ~/.ssh/config
identityFile: ~/.ssh/id_rsa
forwardAgent: true
multiplexing: true
sshOptions:
UserKnownHostsFile: /dev/null
StrictHostKeyChecking: no
stage: production
roles:
- app
- db
deploy_path: ~/app
extra_param: "foo {{hostname}}"
deploy.php<?php
namespace Deployer;
require 'recipe/common.php';
require 'recipe/rsync.php';
// Project name
set('application', 'testPull');
// Project repository
set('repository', '[email protected]:_inc/xxx.git');
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', false);
// Shared files/dirs between deploys
set('shared_files', []);
set('shared_dirs', []);
// Writable dirs by web server
set('writable_dirs', []);
set('allow_anonymous_stats', false);
set('branch', 'master');
set('release_name', function(){
return date('YmdHis');
});
// Hosts
inventory('hosts.yml');
// Tasks
task('build',function(){
set('deploy_path', '/root/{{application}}');
invoke('deploy:info');
invoke('deploy:prepare');
invoke('deploy:lock');
invoke('deploy:release');
invoke('deploy:update_code');
invoke('deploy:shared');
invoke('deploy:writable');
invoke('deploy:clear_paths');
invoke('deploy:symlink');
invoke('deploy:unlock');
invoke('cleanup');
invoke('success');
})->local()->desc('build local project');
// [Optional] If deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
Exception trace:
() at phar:///usr/local/bin/dep/src/Host/HostSelector.php:75
Deployer\Host\HostSelector->getHosts() at phar:///usr/local/bin/dep/src/Console/TaskCommand.php:118
Deployer\Console\TaskCommand->execute() at phar:///usr/local/bin/dep/vendor/symfony/console/Command/Command.php:264
Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/dep/vendor/symfony/console/Application.php:869
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/dep/src/Console/Application.php:132
Deployer\Console\Application->doRunCommand() at phar:///usr/local/bin/dep/vendor/symfony/console/Application.php:223
Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/dep/vendor/symfony/console/Application.php:130
Symfony\Component\Console\Application->run() at phar:///usr/local/bin/dep/src/Deployer.php:324
Deployer\Deployer::run() at phar:///usr/local/bin/dep/bin/dep:119
require() at /usr/local/bin/dep:4
dep deploy production
Or add to your _deploy.php_:
set('default_stage', 'production');
This issue should be closed.
Most helpful comment
dep deploy productionOr add to your _deploy.php_: