@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/pipeline",
3
- "version": "1.0.39-matttest.21",
3
+ "version": "1.0.39-matttest.23",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -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
+ };
@@ -1,4 +1,4 @@
1
- import { $ } from 'zx';
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
- const manifestCheck =
37
- await $`docker manifest inspect ${JF_REGISTRY_FULL_URL}/${IMAGE_NAME}`
38
- .quiet()
39
- .catch(() => null);
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 (manifestCheck?.exitCode === 0) {
47
+ if (manifestExists) {
42
48
  console.log(
43
49
  `Tag sha-${gitSha} already exists in the remote repository. Skipping push.`,
44
50
  );