@docupace/pipeline 1.0.39-matttest.21 → 1.0.39-matttest.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/package.json +1 -1
- package/src/next/logger.js +17 -0
- package/src/next/publish.js +12 -6
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { $ as original$ } from 'zx';
|
|
2
|
+
|
|
3
|
+
// Wrapped version of $
|
|
4
|
+
export const $ = async (strings, ...values) => {
|
|
5
|
+
const command = strings.reduce(
|
|
6
|
+
(acc, str, i) => acc + str + (values[i] ?? ''),
|
|
7
|
+
'',
|
|
8
|
+
);
|
|
9
|
+
console.log(`Executing: ${command}`);
|
|
10
|
+
try {
|
|
11
|
+
const result = await original$(strings, ...values);
|
|
12
|
+
return result;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.error(`Error executing: ${command}`, error);
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
};
|
package/src/next/publish.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ } from '
|
|
1
|
+
import { $ } from './logger.js';
|
|
2
2
|
|
|
3
3
|
const {
|
|
4
4
|
JF_REGISTRY_URL,
|
|
@@ -33,12 +33,18 @@ export async function publish(gitSha) {
|
|
|
33
33
|
|
|
34
34
|
await loginRegistry();
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
let manifestExists = false;
|
|
37
|
+
try {
|
|
38
|
+
$.verbose = false; // Silence output temporarily
|
|
39
|
+
await $`docker manifest inspect ${JF_REGISTRY_FULL_URL}/${IMAGE_NAME}`;
|
|
40
|
+
manifestExists = true;
|
|
41
|
+
} catch {
|
|
42
|
+
manifestExists = false;
|
|
43
|
+
} finally {
|
|
44
|
+
$.verbose = true; // Restore normal output
|
|
45
|
+
}
|
|
40
46
|
|
|
41
|
-
if (
|
|
47
|
+
if (manifestExists) {
|
|
42
48
|
console.log(
|
|
43
49
|
`Tag sha-${gitSha} already exists in the remote repository. Skipping push.`,
|
|
44
50
|
);
|