Skip to content

Commit b2fda35

Browse files
feat: add --no-cache option to build script executors command for docker image builds
1 parent 580b599 commit b2fda35

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ProcessMaker/Console/Commands/BuildScriptExecutors.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class BuildScriptExecutors extends Command
2222
{lang : The ID or language of the script executor}
2323
{user? : The user ID to send the broadcast event to}
2424
{--rebuild : Rebuild the docker image}
25+
{--no-cache : Do not use cache when building the docker image}
2526
{--build-args= : The build arguments for the docker build command}';
2627

2728
/**
@@ -159,9 +160,13 @@ public function buildExecutor()
159160

160161
$this->info('Building the docker executor');
161162

163+
// Add the --no-cache flag if the option is set
164+
$noCache = $this->option('no-cache') ? '--no-cache' : '';
165+
162166
$image = $scriptExecutor->dockerImageName();
163-
$command = Docker::command() .
164-
" build --build-arg SDK_DIR=./sdk -t {$image} -f {$packagePath}/Dockerfile.custom {$packagePath}";
167+
168+
$command = Docker::command() . " build {$noCache}";
169+
$command .= " --build-arg SDK_DIR=./sdk -t {$image} -f {$packagePath}/Dockerfile.custom {$packagePath}";
165170

166171
$buildArgs = $this->getBuildArgs();
167172

0 commit comments

Comments
 (0)