|
5 | 5 | use Exception;
|
6 | 6 | use Illuminate\Console\Command;
|
7 | 7 | use ProcessMaker\Events\BuildScriptExecutor;
|
| 8 | +use ProcessMaker\Exception\InvalidDockerImageException; |
8 | 9 | use ProcessMaker\Facades\Docker;
|
9 | 10 | use ProcessMaker\Models\ScriptExecutor;
|
10 | 11 |
|
@@ -71,7 +72,7 @@ public function handle()
|
71 | 72 | $this->userId = $this->argument('user');
|
72 | 73 | try {
|
73 | 74 | $this->buildExecutor();
|
74 |
| - } catch (\Exception $e) { |
| 75 | + } catch (Exception $e) { |
75 | 76 | if ($this->userId) {
|
76 | 77 | event(new BuildScriptExecutor($e->getMessage(), $this->userId, 'error'));
|
77 | 78 | }
|
@@ -153,7 +154,8 @@ public function buildExecutor()
|
153 | 154 | $this->info('Building the docker executor');
|
154 | 155 |
|
155 | 156 | $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}"; |
157 | 159 |
|
158 | 160 | if ($this->userId) {
|
159 | 161 | $this->runProc(
|
@@ -229,7 +231,7 @@ private function associateWithExistingImage($executor)
|
229 | 231 | $instance = config('app.instance');
|
230 | 232 | foreach ($images as $image) {
|
231 | 233 | 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); |
233 | 235 | }
|
234 | 236 | $id = intval($match[1]);
|
235 | 237 | $existingExecutor = ScriptExecutor::find($id);
|
|
0 commit comments