Escape function build command
The extra trim is neded to because the extra quotes interfere with additional operations in the executor/orchestration library.
This commit is contained in:
parent
97261762e7
commit
7273d0e117
|
@ -394,7 +394,6 @@ class Builds extends Action
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$command = $deployment->getAttribute('commands', '');
|
$command = $deployment->getAttribute('commands', '');
|
||||||
$command = \str_replace('"', '\\"', $command);
|
|
||||||
|
|
||||||
$response = null;
|
$response = null;
|
||||||
$err = null;
|
$err = null;
|
||||||
|
@ -403,7 +402,7 @@ class Builds extends Action
|
||||||
Co\go(function () use ($executor, &$response, $project, $deployment, $source, $function, $runtime, $vars, $command, &$err) {
|
Co\go(function () use ($executor, &$response, $project, $deployment, $source, $function, $runtime, $vars, $command, &$err) {
|
||||||
try {
|
try {
|
||||||
$version = $function->getAttribute('version', 'v2');
|
$version = $function->getAttribute('version', 'v2');
|
||||||
$command = $version === 'v2' ? 'tar -zxf /tmp/code.tar.gz -C /usr/code && cd /usr/local/src/ && ./build.sh' : 'tar -zxf /tmp/code.tar.gz -C /mnt/code && helpers/build.sh "' . $command . '"';
|
$command = $version === 'v2' ? 'tar -zxf /tmp/code.tar.gz -C /usr/code && cd /usr/local/src/ && ./build.sh' : 'tar -zxf /tmp/code.tar.gz -C /mnt/code && helpers/build.sh "' . \trim(\escapeshellarg($command), "\'") . '"';
|
||||||
|
|
||||||
$response = $executor->createRuntime(
|
$response = $executor->createRuntime(
|
||||||
deploymentId: $deployment->getId(),
|
deploymentId: $deployment->getId(),
|
||||||
|
|
Loading…
Reference in a new issue