UNPKG

1.67 kBTypeScriptView Raw
1import { SoftwareEnvironment } from '@stencila/schema';
2import Generator from './Generator';
3import IUrlFetcher from './IUrlFetcher';
4/**
5 * A Dockerfile generator that collects instructions from
6 * all the other generators to allow for images that support
7 * multiple languages.
8 */
9export default class DockerGenerator extends Generator {
10 /**
11 * The software environment for which a Dockerfile
12 * will be generated
13 */
14 environ: SoftwareEnvironment;
15 /**
16 * The child generators from which this 'super' generator
17 * collects instructions.
18 */
19 protected generators: Array<Generator>;
20 constructor(urlFetcher: IUrlFetcher, environ: SoftwareEnvironment, folder?: string);
21 /**
22 * Collect arrays of string from each child generator
23 * and flatten them into an array of strings.
24 * Used below for method overrides.
25 *
26 * @param func The child generator method to call
27 */
28 private collect;
29 /**
30 * Join strings from each child generator
31 *
32 * @param func The child generator method to call
33 */
34 private join;
35 applies(): boolean;
36 baseVersion(): string;
37 envVars(sysVersion: string): Array<[string, string]>;
38 aptKeysCommand(sysVersion: string): string | undefined;
39 aptRepos(sysVersion: string): Array<string>;
40 aptPackages(sysVersion: string): Array<string>;
41 stencilaInstall(sysVersion: string): string | undefined;
42 installFiles(sysVersion: string): Array<[string, string]>;
43 installCommand(sysVersion: string): string | undefined;
44 projectFiles(sysVersion: string): Array<[string, string]>;
45 runCommand(sysVersion: string): string | undefined;
46}