UNPKG

2.78 kBTypeScriptView Raw
1import { GoalInvocation } from "@atomist/sdm";
2import { GlobPatterns } from "./publishToS3";
3/**
4 * Specify how to publish a project's output to S3.
5 */
6export interface PublishToS3Options {
7 /**
8 * Name of this publish operation. Make it unique per push.
9 */
10 uniqueName: string;
11 /**
12 * Name of the bucket. For example: docs.atomist.com
13 */
14 bucketName: string;
15 /**
16 * AWS region. For example: us-west-2
17 * This is used to construct a URL that the goal will link to
18 */
19 region: string;
20 /**
21 * Select the files to publish. This is an array of glob patterns.
22 * For example: [ "target/**\/*", "index.html" ],
23 */
24 filesToPublish: GlobPatterns;
25 /**
26 * Function from a file path within this project to a key (path
27 * within the bucket) where it belongs on S3. You can use the
28 * invocation to see the SHA and branch, in case you want to
29 * upload to a branch- or commit-specific place inside the bucket.
30 */
31 pathTranslation?: (filePath: string, inv: GoalInvocation) => string;
32 /**
33 * The file or path within the project represents the root of the
34 * uploaded site. This is a path within the project. It will be
35 * passed to pathTranslation to get the path within the bucket
36 * when generating the link to the completed goal. If it is not
37 * provided, no externalUrl is provided in the goal result.
38 */
39 pathToIndex?: string;
40 /**
41 * A label for the link to the uploaded files. This will appear
42 * on the successful goal in a push notification (when pathToIndex is defined).
43 * Default is "S3 Website"
44 */
45 linkLabel?: string;
46 /**
47 * If true, delete objects from S3 bucket that do not map to files
48 * in the repository being copied to the bucket. If false, files
49 * from the repository are copied to the bucket but no existing
50 * objects in the bucket are deleted.
51 */
52 sync?: boolean;
53 /**
54 * If set, look for hidden files with this extension (otherwise
55 * matching the names of files to be uploaded) for additional
56 * parameter properties to supply to the argument of S3.putObject.
57 *
58 * For example, if a file "X" is being uploaded and the value of
59 * `paramsExt` is ".s3params" and there is a file ".X.s3params" in
60 * the same directory, the contents of the ".X.s3params" file are
61 * parsed as JSON and merged into the parameters used as the
62 * argument to the S3.putObject function with the former taking
63 * precedence, i.e., the values in ".X.s3params" take override the
64 * default property values.
65 */
66 paramsExt?: string;
67 /**
68 * If set, use the proxy string supplied
69 */
70 proxy?: string;
71}
72//# sourceMappingURL=options.d.ts.map
\No newline at end of file