From 70700a2965fe096f387e89dee91575dcaca51169 Mon Sep 17 00:00:00 2001 From: Enrique Ponce De Leon Date: Wed, 30 Jul 2025 11:50:00 -0400 Subject: [PATCH] adding --no-build logic to installer --- composer.json | 2 +- src/DockerExecutorNodeServiceProvider.php | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index f208ec1..b372538 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "processmaker/docker-executor-node", "friendly_name": "Javascript Docker Executor", "description": "Javascript script executor for processmaker 4", - "version": "1.1.0", + "version": "1.1.1", "minimum-stability": "dev", "license": "GAGPL-3.0-or-later", "autoload": { diff --git a/src/DockerExecutorNodeServiceProvider.php b/src/DockerExecutorNodeServiceProvider.php index 0620263..d62c539 100644 --- a/src/DockerExecutorNodeServiceProvider.php +++ b/src/DockerExecutorNodeServiceProvider.php @@ -11,7 +11,7 @@ class DockerExecutorNodeServiceProvider extends ServiceProvider { use PluginServiceProviderTrait; - const version = '1.0.2'; // Required for PluginServiceProviderTrait + public const version = '1.1.1'; // Required for PluginServiceProviderTrait public function register() { @@ -19,7 +19,7 @@ public function register() public function boot() { - \Artisan::command('docker-executor-node:install {--rebuild}', function () { + \Artisan::command('docker-executor-node:install {--rebuild} {--no-build : Skip building the script executor image}', function () { $scriptExecutor = ScriptExecutor::install([ 'language' => 'javascript', 'title' => 'Node Executor', @@ -27,16 +27,19 @@ public function boot() ]); // Build the instance image. This is the same as if you were to build it from the admin UI - $cmd = 'processmaker:build-script-executor ' . $scriptExecutor->id; - if ($this->option('rebuild')) { - $cmd .= ' --rebuild'; + // Skip building the image if the --no-build option is passed + if (!$this->option('no-build')) { + $cmd = 'processmaker:build-script-executor ' . $scriptExecutor->id; + if ($this->option('rebuild')) { + $cmd .= ' --rebuild'; + } + $this->info("Running artisan cmd: $cmd"); + \Artisan::call($cmd); + $this->info(\Artisan::output()); } - $this->info("Running artisan cmd: $cmd"); - \Artisan::call($cmd); - $this->info(\Artisan::output()); // Restart the workers so they know about the new supported language - \Artisan::call('horizon:terminate'); + //\Artisan::call('horizon:terminate'); }); $this->commands([TestDocs::class]);