mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
demo (#392)
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
|
||||
use App\Exceptions\SSHConnectionError;
|
||||
use App\Helpers\SSH;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Support\Traits\ReflectsClosures;
|
||||
use PHPUnit\Framework\Assert;
|
||||
|
||||
@ -28,6 +29,21 @@ public function __construct(?string $output = null)
|
||||
$this->output = $output;
|
||||
}
|
||||
|
||||
public function init(Server $server, ?string $asUser = null): self
|
||||
{
|
||||
$this->connection = null;
|
||||
$this->log = null;
|
||||
$this->asUser = null;
|
||||
$this->server = $server->refresh();
|
||||
$this->user = $server->getSshUser();
|
||||
if ($asUser && $asUser != $server->getSshUser()) {
|
||||
$this->user = $asUser;
|
||||
$this->asUser = $asUser;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function connectionWillFail(): void
|
||||
{
|
||||
$this->connectionWillFail = true;
|
||||
|
Reference in New Issue
Block a user