MCPcopy
hub / github.com/firecow/gitlab-ci-local / mountCacheCmd

Method mountCacheCmd

src/job.ts:863–877  ·  view source on GitHub ↗
(writeStreams: WriteStreams, expanded: {[key: string]: string})

Source from the content-addressed store, hash-verified

861 }
862
863 private async mountCacheCmd (writeStreams: WriteStreams, expanded: {[key: string]: string}) {
864 if (this.imageName(expanded) && !this.argv.mountCache) return [];
865
866 const cmd: string[] = [];
867 for (const [index, c] of this.cache.entries()) {
868 const uniqueCacheName = await this.getUniqueCacheName(this.argv.cwd, expanded, index);
869 c.paths.forEach((p) => {
870 const path = Utils.expandText(p, expanded);
871 writeStreams.stdout(chalk`${this.formattedJobName} {magentaBright mounting cache} for path ${path}\n`);
872 const cacheMount = Utils.safeDockerString(`gcl-${expanded.CI_PROJECT_PATH_SLUG}-${uniqueCacheName}`);
873 cmd.push("-v", `${cacheMount}:${this.ciProjectDir}/${path}`);
874 });
875 }
876 return cmd;
877 }
878
879 private async execPreScripts (expanded: {[key: string]: string}): Promise<void> {
880 const prescripts = this.beforeScripts.concat(this.scripts);

Callers 2

execScriptsMethod · 0.95
copyArtifactsOutMethod · 0.95

Calls 5

imageNameMethod · 0.95
getUniqueCacheNameMethod · 0.95
expandTextMethod · 0.80
safeDockerStringMethod · 0.80
stdoutMethod · 0.45

Tested by

no test coverage detected