mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Make used shell configurable (#1536)
This commit is contained in:
parent
96f5edaebe
commit
ac1b970bda
@ -53,6 +53,7 @@ class FileLoader
|
||||
'multiplexing',
|
||||
'sshOptions',
|
||||
'sshFlags',
|
||||
'shellCommand',
|
||||
];
|
||||
|
||||
foreach ($methods as $method) {
|
||||
|
@ -25,6 +25,7 @@ class Host
|
||||
private $forwardAgent = true;
|
||||
private $multiplexing = null;
|
||||
private $sshArguments;
|
||||
private $shellCommand = 'bash -s';
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
@ -239,6 +240,21 @@ class Host
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getShellCommand() : string
|
||||
{
|
||||
return $this->shellCommand;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $shellCommand
|
||||
* @return $this
|
||||
*/
|
||||
public function shellCommand(string $shellCommand)
|
||||
{
|
||||
$this->shellCommand = $shellCommand;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set stage
|
||||
*
|
||||
|
@ -80,7 +80,9 @@ class Client
|
||||
$sshArguments = $this->initMultiplexing($host);
|
||||
}
|
||||
|
||||
$ssh = "ssh $sshArguments $host $become 'bash -s; printf \"[exit_code:%s]\" $?;'";
|
||||
$shellCommand = $host->getShellCommand();
|
||||
|
||||
$ssh = "ssh $sshArguments $host $become '$shellCommand; printf \"[exit_code:%s]\" $?;'";
|
||||
|
||||
$process = new Process($ssh);
|
||||
$process
|
||||
|
Loading…
x
Reference in New Issue
Block a user