mercury-agent 0.4.21 → 0.4.23
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/src/cli/mercury.ts
CHANGED
|
@@ -185,22 +185,24 @@ async function runAction(): Promise<void> {
|
|
|
185
185
|
stdio: "pipe",
|
|
186
186
|
});
|
|
187
187
|
if (imageCheck.status !== 0) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
stdio: "
|
|
188
|
+
const isRegistryImage = imageName.includes("/");
|
|
189
|
+
if (isRegistryImage) {
|
|
190
|
+
console.log(`Image '${imageName}' not found locally, pulling...`);
|
|
191
|
+
const pull = spawnSync("docker", ["pull", imageName], {
|
|
192
|
+
stdio: "inherit",
|
|
193
193
|
});
|
|
194
|
-
if (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
194
|
+
if (pull.signal) {
|
|
195
|
+
process.exit(1);
|
|
196
|
+
}
|
|
197
|
+
if (pull.status !== 0) {
|
|
198
|
+
const firstSegment = imageName.split("/")[0];
|
|
199
|
+
const registry = firstSegment.includes(".")
|
|
200
|
+
? firstSegment
|
|
201
|
+
: "docker.io";
|
|
202
|
+
console.error(`\nError: Failed to pull '${imageName}'.`);
|
|
201
203
|
console.error(
|
|
202
|
-
|
|
203
|
-
`
|
|
204
|
+
"If this is a private registry, authenticate first:\n" +
|
|
205
|
+
` docker login ${registry}`,
|
|
204
206
|
);
|
|
205
207
|
process.exit(1);
|
|
206
208
|
}
|
|
@@ -274,7 +276,9 @@ function buildAction(): void {
|
|
|
274
276
|
copyDirRecursive(resourcesSrc, resourcesDest);
|
|
275
277
|
if (!existsSync(resourcesDest)) {
|
|
276
278
|
console.error(`❌ Failed to copy resources/ into build context`);
|
|
277
|
-
console.error(
|
|
279
|
+
console.error(
|
|
280
|
+
` Source: ${resourcesSrc} (exists: ${existsSync(resourcesSrc)})`,
|
|
281
|
+
);
|
|
278
282
|
console.error(` Dest: ${resourcesDest}`);
|
|
279
283
|
process.exit(1);
|
|
280
284
|
}
|