Skip to content

Commit 6e26afa

Browse files
authored
Merge pull request #6175 from ProcessMaker/observation/FOUR-11513
Observation/FOUR-11513: Error integrating sdk-java
2 parents 2a4a898 + 0f0c672 commit 6e26afa

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

ProcessMaker/Console/Commands/BuildScriptExecutors.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Exception;
66
use Illuminate\Console\Command;
77
use ProcessMaker\Events\BuildScriptExecutor;
8+
use ProcessMaker\Exception\InvalidDockerImageException;
89
use ProcessMaker\Facades\Docker;
910
use ProcessMaker\Models\ScriptExecutor;
1011

@@ -71,7 +72,7 @@ public function handle()
7172
$this->userId = $this->argument('user');
7273
try {
7374
$this->buildExecutor();
74-
} catch (\Exception $e) {
75+
} catch (Exception $e) {
7576
if ($this->userId) {
7677
event(new BuildScriptExecutor($e->getMessage(), $this->userId, 'error'));
7778
}
@@ -153,7 +154,8 @@ public function buildExecutor()
153154
$this->info('Building the docker executor');
154155

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

158160
if ($this->userId) {
159161
$this->runProc(
@@ -229,7 +231,7 @@ private function associateWithExistingImage($executor)
229231
$instance = config('app.instance');
230232
foreach ($images as $image) {
231233
if (!preg_match('/executor-' . $instance . '-.+-(\d+):/', $image, $match)) {
232-
throw new \Exception('Not a valid image:' . (string) $image);
234+
throw new InvalidDockerImageException('Not a valid image:' . (string) $image);
233235
}
234236
$id = intval($match[1]);
235237
$existingExecutor = ScriptExecutor::find($id);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace ProcessMaker\Exception;
4+
5+
use Exception;
6+
7+
class InvalidDockerImageException extends Exception
8+
{
9+
public function __construct($message)
10+
{
11+
parent::__construct($message);
12+
}
13+
}

0 commit comments

Comments
 (0)