summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-07-11 22:10:48 -0700
committerElizabeth Hunt <me@liz.coffee>2025-07-11 22:10:48 -0700
commit07075060900bcfcb84758657946632a1b9750683 (patch)
treedb565b672d6ac7a64e3762cb63443e2efbd64ac3
parentf008c002915ee19b5bf93b6cae648f10ca861a22 (diff)
downloadci-07075060900bcfcb84758657946632a1b9750683.tar.gz
ci-07075060900bcfcb84758657946632a1b9750683.zip
Command needs to be a List of Commands
-rwxr-xr-xworker/scripts/checkout_ci.ts50
1 files changed, 25 insertions, 25 deletions
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<Error, unknown>(() => JSON.parse(fileText)))
- .flatMap((json) => {
- return eitherCiJob.flatMap(
- (ciJob): IEither<Error, { commands: Array<Command>; 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<Error, { commands: Array<Command>; 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',
+ ],
]);
}