Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fox sonarCube issues
  • Loading branch information
agustinbusso committed Feb 7, 2024
commit 0f0c6727583a260e32b16cfc59715672375a1b10
6 changes: 4 additions & 2 deletions ProcessMaker/Console/Commands/BuildScriptExecutors.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Exception;
use Illuminate\Console\Command;
use ProcessMaker\Events\BuildScriptExecutor;
use ProcessMaker\Exception\InvalidDockerImageException;
use ProcessMaker\Facades\Docker;
use ProcessMaker\Models\ScriptExecutor;

Expand Down Expand Up @@ -153,7 +154,8 @@ public function buildExecutor()
$this->info('Building the docker executor');

$image = $scriptExecutor->dockerImageName();
$command = Docker::command() . " build --build-arg SDK_DIR=./sdk -t {$image} -f {$packagePath}/Dockerfile.custom {$packagePath}";
$command = Docker::command() .
" build --build-arg SDK_DIR=./sdk -t {$image} -f {$packagePath}/Dockerfile.custom {$packagePath}";

if ($this->userId) {
$this->runProc(
Expand Down Expand Up @@ -229,7 +231,7 @@ private function associateWithExistingImage($executor)
$instance = config('app.instance');
foreach ($images as $image) {
if (!preg_match('/executor-' . $instance . '-.+-(\d+):/', $image, $match)) {
throw new Exception('Not a valid image:' . (string) $image);
throw new InvalidDockerImageException('Not a valid image:' . (string) $image);
}
$id = intval($match[1]);
$existingExecutor = ScriptExecutor::find($id);
Expand Down
13 changes: 13 additions & 0 deletions ProcessMaker/Exception/InvalidDockerImageException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace ProcessMaker\Exception;

use Exception;

class InvalidDockerImageException extends Exception
{
public function __construct($message)
{
parent::__construct($message);
}
}