Skip to content

Commit

Permalink
Merge pull request #2206 from maurobender/fix_schduled_tasks_executin…
Browse files Browse the repository at this point in the history
…g_using_host_environment

Fix scheduled tasks being executed using host environment variables
  • Loading branch information
andrasbacsai authored May 15, 2024
2 parents 576cbc0 + cc870ca commit 5b8a923
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Jobs/ScheduledTaskJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function handle(): void

foreach ($this->containers as $containerName) {
if (count($this->containers) == 1 || str_starts_with($containerName, $this->task->container . '-' . $this->resource->uuid)) {
$cmd = 'sh -c "' . str_replace('"', '\"', $this->task->command) . '"';
$cmd = "sh -c '" . str_replace("'", "'\''", $this->task->command) . "'";
$exec = "docker exec {$containerName} {$cmd}";
$this->task_output = instant_remote_process([$exec], $this->server, true);
$this->task_log->update([
Expand Down

0 comments on commit 5b8a923

Please sign in to comment.