mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
remove some logs
This commit is contained in:
@ -76,10 +76,6 @@ public function connect(bool $sftp = false): void
|
||||
if (! $login) {
|
||||
throw new SSHAuthenticationError("Error authenticating");
|
||||
}
|
||||
|
||||
Log::info("Login status", [
|
||||
'status' => $login
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
Log::error("Error connecting", [
|
||||
"msg" => $e->getMessage()
|
||||
@ -122,15 +118,10 @@ public function upload(string $local, string $remote): void
|
||||
{
|
||||
$this->log = null;
|
||||
|
||||
Log::info("Starting to upload");
|
||||
if (! $this->connection) {
|
||||
$this->connect(true);
|
||||
}
|
||||
Log::info("Uploading");
|
||||
$uploaded = $this->connection->put($remote, $local, SFTP::SOURCE_LOCAL_FILE);
|
||||
Log::info("Upload finished", [
|
||||
'status' => $uploaded
|
||||
]);
|
||||
$this->connection->put($remote, $local, SFTP::SOURCE_LOCAL_FILE);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,28 +130,17 @@ public function upload(string $local, string $remote): void
|
||||
protected function executeCommand(string|SSHCommand $command): string
|
||||
{
|
||||
if ($command instanceof SSHCommand) {
|
||||
$commandContent = $command->content($this->server->os);
|
||||
$commandContent = $command->content();
|
||||
} else {
|
||||
$commandContent = $command;
|
||||
}
|
||||
|
||||
Log::info("command", [
|
||||
"asUser" => $this->asUser,
|
||||
"content" => $commandContent
|
||||
]);
|
||||
|
||||
if ($this->asUser) {
|
||||
$commandContent = 'sudo su - '.$this->asUser.' -c '.'"'.addslashes($commandContent).'"';
|
||||
}
|
||||
|
||||
Log::info("Running command", [
|
||||
"cmd" => $commandContent
|
||||
]);
|
||||
|
||||
$output = $this->connection->exec($commandContent);
|
||||
|
||||
Log::info("Command executed");
|
||||
|
||||
$this->log?->write($output);
|
||||
|
||||
if (Str::contains($output, 'VITO_SSH_ERROR')) {
|
||||
|
Reference in New Issue
Block a user