Skip to content

Observation/FOUR-11513: Error integrating sdk-java #6175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 5 additions & 3 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 @@ -71,7 +72,7 @@ public function handle()
$this->userId = $this->argument('user');
try {
$this->buildExecutor();
} catch (\Exception $e) {
} catch (Exception $e) {
if ($this->userId) {
event(new BuildScriptExecutor($e->getMessage(), $this->userId, 'error'));
}
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);
}
}