-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathoptions.ts
122 lines (109 loc) · 2.95 KB
/
options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/**
* Determines how symlinks are followed.
*/
export enum SymlinkFollowMode {
/**
* Never follow symlinks.
*/
NEVER = 'never',
/**
* Materialize all symlinks, whether they are internal or external to the source directory.
*/
ALWAYS = 'always',
/**
* Only follows symlinks that are external to the source directory.
*/
EXTERNAL = 'external',
/**
* Forbids source from having any symlinks pointing outside of the source
* tree.
*
* This is the safest mode of operation as it ensures that copy operations
* won't materialize files from the user's file system. Internal symlinks are
* not followed.
*
* If the copy operation runs into an external symlink, it will fail.
*/
BLOCK_EXTERNAL = 'internal-only',
}
/**
* Determines the ignore behavior to use.
*/
export enum IgnoreMode {
/**
* Ignores file paths based on simple glob patterns.
*
* This is the default for file assets.
*
* It is also the default for Docker image assets, unless the '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport'
* context flag is set.
*/
GLOB = 'glob',
/**
* Ignores file paths based on the [`.gitignore specification`](https://git-scm.com/docs/gitignore).
*/
GIT = 'git',
/**
* Ignores file paths based on the [`.dockerignore specification`](https://docs.docker.com/engine/reference/builder/#dockerignore-file).
*
* This is the default for Docker image assets if the '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport'
* context flag is set.
*/
DOCKER = 'docker',
}
interface FileOptions {
/**
* File paths matching the patterns will be excluded. See `ignoreMode` to set the matching behavior.
* Has no effect on Assets bundled using the `bundling` property.
*
* @default - nothing is excluded
*/
readonly exclude?: string[];
/**
* The ignore behavior to use for `exclude` patterns.
*
* @default IgnoreMode.GLOB
*/
readonly ignoreMode?: IgnoreMode;
}
/**
* Options applied when copying directories
*/
export interface CopyOptions extends FileOptions {
/**
* A strategy for how to handle symlinks.
*
* @default SymlinkFollowMode.NEVER
*/
readonly follow?: SymlinkFollowMode;
}
/**
* Options applied when copying directories into the staging location.
*/
export interface FileCopyOptions extends FileOptions {
/**
* A strategy for how to handle symlinks.
*
* @default SymlinkFollowMode.NEVER
*/
readonly followSymlinks?: SymlinkFollowMode;
}
interface ExtraHashOptions {
/**
* Extra information to encode into the fingerprint (e.g. build instructions
* and other inputs)
*
* @default - hash is only based on source content
*/
readonly extraHash?: string;
}
/**
* Options related to calculating source hash.
*/
export interface FingerprintOptions extends CopyOptions, ExtraHashOptions {
}
/**
* Options related to calculating source hash.
*/
export interface FileFingerprintOptions extends FileCopyOptions, ExtraHashOptions {
}