npm-pkgbuild 11.1.12 → 11.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/package.json +1 -1
- package/src/output/docker.mjs +20 -3
package/README.md
CHANGED
|
@@ -116,6 +116,7 @@ see [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
116
116
|
* [fields](#fields)
|
|
117
117
|
* [fields](#fields-1)
|
|
118
118
|
* [fields](#fields-2)
|
|
119
|
+
* [fields](#fields-3)
|
|
119
120
|
* [hookMapping](#hookmapping)
|
|
120
121
|
* [hookMapping](#hookmapping-1)
|
|
121
122
|
* [Field](#field)
|
|
@@ -272,6 +273,10 @@ well known package properties
|
|
|
272
273
|
|
|
273
274
|
## fields
|
|
274
275
|
|
|
276
|
+
* **See**: {<https://docs.docker.com/engine/reference/builder/}>
|
|
277
|
+
|
|
278
|
+
## fields
|
|
279
|
+
|
|
275
280
|
* **See**: <https://rpm-packaging-guide.github.io>
|
|
276
281
|
|
|
277
282
|
## hookMapping
|
package/package.json
CHANGED
package/src/output/docker.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
2
3
|
import { execa } from "execa";
|
|
3
4
|
import { EmptyContentEntry, ReadableStreamContentEntry } from "content-entry";
|
|
5
|
+
import { transform } from "content-entry-transform";
|
|
6
|
+
import { aggregateFifo } from "aggregate-async-iterator";
|
|
4
7
|
import {
|
|
5
8
|
keyValueTransformer,
|
|
6
9
|
equalSeparatedKeyValuePairOptions
|
|
7
10
|
} from "key-value-transformer";
|
|
8
11
|
import { Packager } from "./packager.mjs";
|
|
9
|
-
import { fieldProvider } from "../util.mjs";
|
|
12
|
+
import { fieldProvider, copyEntries, utf8StreamOptions } from "../util.mjs";
|
|
10
13
|
|
|
11
14
|
const DOCKERFILE = "Dockerfile";
|
|
12
15
|
|
|
@@ -44,7 +47,7 @@ ENTRYPOINT ["node", ""]
|
|
|
44
47
|
match: entry => entry.name === DOCKERFILE,
|
|
45
48
|
transform: async entry =>
|
|
46
49
|
new ReadableStreamContentEntry(
|
|
47
|
-
|
|
50
|
+
entry.name,
|
|
48
51
|
keyValueTransformer(await entry.readStream, fp, {
|
|
49
52
|
...equalSeparatedKeyValuePairOptions,
|
|
50
53
|
trailingLines
|
|
@@ -53,8 +56,22 @@ ENTRYPOINT ["node", ""]
|
|
|
53
56
|
createEntryWhenMissing: () => new EmptyContentEntry(DOCKERFILE)
|
|
54
57
|
});
|
|
55
58
|
|
|
59
|
+
for await (const file of copyEntries(
|
|
60
|
+
transform(aggregateFifo(sources), transformer),
|
|
61
|
+
staging,
|
|
62
|
+
expander
|
|
63
|
+
)) {
|
|
64
|
+
if (options.verbose) {
|
|
65
|
+
console.log("D", file.destination);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (options.verbose) {
|
|
70
|
+
console.log(await readFile(join(staging, DOCKERFILE), utf8StreamOptions));
|
|
71
|
+
}
|
|
72
|
+
|
|
56
73
|
if (!options.dry) {
|
|
57
|
-
const docker = await execa("docker", ["build",
|
|
74
|
+
const docker = await execa("docker", ["build", staging], {
|
|
58
75
|
cwd: staging
|
|
59
76
|
});
|
|
60
77
|
|