Skip to content
Open
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
21 changes: 12 additions & 9 deletions src/DockerExecutorNodeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,35 @@ 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()
{
}

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',
'description' => 'Default Javascript/Node Executor',
]);

// 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]);
Expand Down