diff options
author | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-18 22:54:15 -0700 |
---|---|---|
committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-18 22:55:20 -0700 |
commit | d54e91c6582ed160cf2f2fcf977e48b4439d133b (patch) | |
tree | 5669367c4fa49bc0373b0c581ea3027218fd5e32 /worker/scripts/run_pipeline | |
parent | 9cf3fc0259730b7dcf47b3ab4a04369e39fb4614 (diff) | |
download | ci-d54e91c6582ed160cf2f2fcf977e48b4439d133b.tar.gz ci-d54e91c6582ed160cf2f2fcf977e48b4439d133b.zip |
snapshottheBigRefactor
Diffstat (limited to 'worker/scripts/run_pipeline')
-rwxr-xr-x | worker/scripts/run_pipeline | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/worker/scripts/run_pipeline b/worker/scripts/run_pipeline deleted file mode 100755 index abb13b3..0000000 --- a/worker/scripts/run_pipeline +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env -S deno run --allow-env --allow-net --allow-run --allow-read --allow-write - -import { PipelineImpl } from "@liz-ci/model"; -import { - getRequiredEnv, - getStdout, - invalidExecutionEntriesOf, - loggerWithPrefix, -} from "@liz-ci/utils"; - -const pipelinePath = getRequiredEnv("pipeline"); -const logger = loggerWithPrefix(() => - `[${new Date().toISOString()}] [run_pipeline.${pipelinePath}]` -); - -const run = async () => { - logger.log("starting pipeline execution~ time to work hard!"); - - const stages = await (Deno.readTextFile(pipelinePath)) - .then(PipelineImpl.from) - .then((pipeline) => pipeline.getStages()); - - for (const stage of stages) { - logger.log("executing stage. do your best little stage :>", stage); - - await Promise.all( - stage.parallelJobs.map(async (job, jobIdx) => { - logger.log(`let's do this little job ok!! ${jobIdx}`, job); - const invalidArgs = invalidExecutionEntriesOf(job.arguments); - if (invalidArgs.length) { - logger.error(`oh nooes`, invalidArgs); - throw new Error("invalid job arguments"); - } - - const result = await getStdout(job.type, { env: job.arguments }); - logger.log(jobIdx, "brought something to you! look :D", { result }); - }), - ); - } - - logger.log("all done! everything worked! yay~ (⑅˘꒳˘)"); -}; - -if (import.meta.main) { - try { - await run(); - } catch (e) { - logger.error("womp womp D:", e); - throw e; - } -} |