mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 22:17:19 +00:00
fix(deploy): preserve deploy key command metadata
This commit is contained in:
1 parent
3729b5c074
commit
a630532308
7 files changed
+335
-159
No files matched your search
@@ -2367,12 +2367,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
||||
if ($this->pull_request_id !== 0) {
|
||||
$this->application_deployment_queue->addLogEntry("Checking out tag pull/{$this->pull_request_id}/head.");
|
||||
}
|
||||
$this->execute_remote_command(
|
||||
[
|
||||
$importCommands,
|
||||
'hidden' => true,
|
||||
]
|
||||
);
|
||||
$this->execute_remote_command(...$this->gitCommandDefinitions($importCommands));
|
||||
$this->create_workdir();
|
||||
$this->execute_remote_command(
|
||||
[
|
||||
@@ -2402,6 +2397,39 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
||||
return $commands;
|
||||
}
|
||||
|
||||
private function gitCommandDefinitions(Collection|array|string $commands): array
|
||||
{
|
||||
if (is_string($commands)) {
|
||||
return [
|
||||
[
|
||||
$commands,
|
||||
'hidden' => true,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
return collect($commands)
|
||||
->map(function ($command): array {
|
||||
if (is_string($command)) {
|
||||
return [
|
||||
$command,
|
||||
'hidden' => true,
|
||||
];
|
||||
}
|
||||
|
||||
if (is_array($command)) {
|
||||
return $command + ['hidden' => true];
|
||||
}
|
||||
|
||||
return [
|
||||
'command' => $command,
|
||||
'hidden' => true,
|
||||
];
|
||||
})
|
||||
->values()
|
||||
->all();
|
||||
}
|
||||
|
||||
private function cleanup_git()
|
||||
{
|
||||
$this->execute_remote_command(
|
||||
|
||||
Reference in new issue
Block a user