From 07075060900bcfcb84758657946632a1b9750683 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Fri, 11 Jul 2025 22:10:48 -0700 Subject: Command needs to be a List of Commands --- worker/scripts/checkout_ci.ts | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'worker/scripts/checkout_ci.ts') diff --git a/worker/scripts/checkout_ci.ts b/worker/scripts/checkout_ci.ts index 1892be8..a44c525 100755 --- a/worker/scripts/checkout_ci.ts +++ b/worker/scripts/checkout_ci.ts @@ -85,20 +85,18 @@ await LogMetricTraceable.ofLogTraceable(_logJob) ); return repoCiFileContents .flatMap((fileText) => Either.fromFailable(() => JSON.parse(fileText))) - .flatMap((json) => { - return eitherCiJob.flatMap( - (ciJob): IEither; job: CheckoutCiJob }> => { - if (!isCiWorkflow(json)) { - const e = new Error("couldn't find any valid ci configuration (。•́︿•̀。), that's okay~"); - return Either.left(e); - } - return Either.right({ - commands: getPipelineGenerationCommand(ciJob, json.workflow), - job: ciJob, - }); - }, - ); - }); + .flatMap((json) => + eitherCiJob.flatMap((ciJob): IEither; job: CheckoutCiJob }> => { + if (!isCiWorkflow(json)) { + const e = new Error("couldn't find any valid ci configuration (。•́︿•̀。), that's okay~"); + return Either.left(e); + } + return Either.right({ + commands: getPipelineGenerationCommand(ciJob, json.workflow), + job: ciJob, + }); + }), + ); }) .map(async (tEitherPipelineGenerationCommand) => { const eitherJobCommand = await tEitherPipelineGenerationCommand.get(); @@ -163,16 +161,18 @@ function getPipelineGenerationCommand( return [ `docker login --username ${credentials.username} --password ${credentials.password} ${registry}`.split(' '), ].concat([ - 'docker', - 'run', - ...runFlags, - ...prependWith( - Object.entries(job.arguments).map(([key, val]) => `"${key}"="${val}"`), - '-e', - ), - '-v', - `${getSrcDirectoryForCiJob(job)}/${pipelineGeneratorPath}:/pipeline_generator`, - image, - '/pipeline_generator', + [ + 'docker', + 'run', + ...runFlags, + ...prependWith( + Object.entries(job.arguments).map(([key, val]) => `"${key}"="${val}"`), + '-e', + ), + '-v', + `${getSrcDirectoryForCiJob(job)}/${pipelineGeneratorPath}:/pipeline_generator`, + image, + '/pipeline_generator', + ], ]); } -- cgit v1.2.3-70-g09d2