-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSource.js
More file actions
47 lines (40 loc) · 1.54 KB
/
Copy pathSource.js
File metadata and controls
47 lines (40 loc) · 1.54 KB
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
// Abstract include source. Implementations: LocalSource, HttpSource, GitSource,
// OciSource. `joinRelative` is always called with a non-scheme relative path —
// scheme detection lives in resolveSource.
class Source {
// eslint-disable-next-line class-methods-use-this
async read() {
throw new Error("Source.read() not implemented")
}
// eslint-disable-next-line class-methods-use-this, no-unused-vars
joinRelative(_relPath) {
throw new Error("Source.joinRelative() not implemented")
}
// eslint-disable-next-line class-methods-use-this
key() {
throw new Error("Source.key() not implemented")
}
// eslint-disable-next-line class-methods-use-this, no-unused-vars
displayPath(_dockerContext) {
throw new Error("Source.displayPath() not implemented")
}
// Stable seed for stage-name slug (md5'd downstream).
// eslint-disable-next-line class-methods-use-this, no-unused-vars
stageAliasBase(_dockerContext) {
throw new Error("Source.stageAliasBase() not implemented")
}
// Real fs path for sources backed by a local file; null otherwise.
// Consumed by postProcessDockerfile (error messages) and stage scoping.
// eslint-disable-next-line class-methods-use-this
fsPath() {
return null
}
// Eagerly resolve the remote identity (oid/digest) so that key() returns a
// stable value before read(). Local sources are no-ops. Override in remote
// sources that need an extra round-trip.
// eslint-disable-next-line class-methods-use-this
async resolve() {
/* no-op */
}
}
module.exports = Source