1 | import Doer from './Doer';
|
2 | /**
|
3 | * Generates a Dockerfile for a `SoftwareEnvironment` instance
|
4 | */
|
5 | export default class Generator extends Doer {
|
6 | /**
|
7 | * Generate a Dockerfile for a `SoftwareEnvironment` instance
|
8 | *
|
9 | * @param comments Should a comments be added to the Dockerfile?
|
10 | * @param stencila Should relevant Stencila language packages be installed in the image?
|
11 | */
|
12 | generate(comments?: boolean, stencila?: boolean): string;
|
13 | /**
|
14 | * Does this generator apply to the package?
|
15 | */
|
16 | applies(): boolean;
|
17 | /**
|
18 | * Name of the base image
|
19 | */
|
20 | baseName(): string;
|
21 | /**
|
22 | * Version of the base image
|
23 | */
|
24 | baseVersion(): string;
|
25 | /**
|
26 | * Get the version name for a base image
|
27 | * @param baseIdentifier The base image name e.g. `ubuntu:18.04`
|
28 | */
|
29 | baseVersionName(baseIdentifier: string): string;
|
30 | /**
|
31 | * Generate a base image identifier
|
32 | */
|
33 | baseIdentifier(): string;
|
34 | /**
|
35 | * A list of environment variables to set in the image
|
36 | * as `name`, `value` pairs
|
37 | *
|
38 | * @param sysVersion The Ubuntu system version being used
|
39 | */
|
40 | envVars(sysVersion: string): Array<[string, string]>;
|
41 | /**
|
42 | * A Bash command to run to install required apt keys
|
43 | *
|
44 | * @param sysVersion The Ubuntu system version being used
|
45 | */
|
46 | aptKeysCommand(sysVersion: string): string | undefined;
|
47 | /**
|
48 | * A list of any required apt repositories
|
49 | *
|
50 | * @param sysVersion The Ubuntu system version being used
|
51 | */
|
52 | aptRepos(sysVersion: string): Array<string>;
|
53 | /**
|
54 | * A list of any required apt packages
|
55 | *
|
56 | * @param sysVersion The Ubuntu system version being used
|
57 | */
|
58 | aptPackages(sysVersion: string): Array<string>;
|
59 | /**
|
60 | * A Bash command to run to install Stencila execution host package/s
|
61 | *
|
62 | * @param sysVersion The Ubuntu system version being used
|
63 | */
|
64 | stencilaInstall(sysVersion: string): string | undefined;
|
65 | /**
|
66 | * A list of files that need to be be copied
|
67 | * into the image before running `installCommand`
|
68 | *
|
69 | * @param sysVersion The Ubuntu system version being used
|
70 | * @returns An array of [src, dest] tuples
|
71 | */
|
72 | installFiles(sysVersion: string): Array<[string, string]>;
|
73 | /**
|
74 | * The Bash command to run to install required language packages
|
75 | *
|
76 | * @param sysVersion The Ubuntu system version being used
|
77 | */
|
78 | installCommand(sysVersion: string): string | undefined;
|
79 | /**
|
80 | * The project's files that should be copied across to the image
|
81 | *
|
82 | * @param sysVersion The Ubuntu system version being used
|
83 | * @returns An array of [src, dest] tuples
|
84 | */
|
85 | projectFiles(sysVersion: string): Array<[string, string]>;
|
86 | /**
|
87 | * The default command to run containers created from this image
|
88 | *
|
89 | * @param sysVersion The Ubuntu system version being used
|
90 | */
|
91 | runCommand(sysVersion: string): string | undefined;
|
92 | }
|