UNPKG

@catladder/pipeline

Version:

Panter workflow for cloud CI/CD and DevOps

36 lines (32 loc) 1.19 kB
import { getRunnerImage } from "../../runner"; import type { Pipeline } from "../../types"; import { globalScriptFunctions } from "../../globalScriptFunctions"; type PickRequired<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>; export const createGitlabPipelineWithDefaults = ({ image, variables, before_script, ...config }: PickRequired< Partial<Pipeline<"gitlab">>, "stages" | "jobs" >): Pipeline<"gitlab"> => { return { image: image ?? getRunnerImage("jobs-default"), // default image variables: { FF_USE_FASTZIP: "true", // enable fastzip - a faster zip implementation that also supports level configuration. ARTIFACT_COMPRESSION_LEVEL: "fast", // we value speed over compression CACHE_COMPRESSION_LEVEL: "fast", // same as above, but for caches TRANSFER_METER_FREQUENCY: "5s", // how often we should update the transfer meter for cache upload/download GIT_DEPTH: "1", // no need the full depth ...(variables ?? {}), }, before_script: [ ...[...globalScriptFunctions.values()].map((script) => script.toBashFunction(), ), ...(before_script ?? []), ], ...config, }; };