@payfit/nx-core 5.3.0 → 5.3.1-ephemeral-frontend-path-annotation.0

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.
@@ -9,6 +9,14 @@ import { ArtifactType } from './enums';
9
9
  * @param ecrRegistry - ECR registry
10
10
  */
11
11
  export declare function pushImageToEcr(ecrRepository: string, tag: string, artifactPath: string, type: ArtifactType.LAMBDA | ArtifactType.FRONTEND, ecrRegistry: string): Promise<void>;
12
+ /**
13
+ * Get annotations to add to the OCI push command
14
+ * @param gitRepoUrl
15
+ * @param commitSha
16
+ * @param type
17
+ * @param tag
18
+ */
19
+ export declare function getOciAnnotations(gitRepoUrl: string, commitSha: string, type: ArtifactType.LAMBDA | ArtifactType.FRONTEND, tag: string): string[];
12
20
  /**
13
21
  * Pushes helm chart as OCI artifact to ECR using ORAS.
14
22
  *
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pushImageToEcr = pushImageToEcr;
4
+ exports.getOciAnnotations = getOciAnnotations;
4
5
  exports.pushHelmOciToEcr = pushHelmOciToEcr;
5
6
  const consola_1 = require("consola");
7
+ const enums_1 = require("./enums");
6
8
  const exec_1 = require("./exec");
7
9
  const github_1 = require("./github");
8
10
  /**
@@ -21,8 +23,7 @@ async function pushImageToEcr(ecrRepository, tag, artifactPath, type, ecrRegistr
21
23
  const artifactType = `application/vnd.payfit.${type}.manifest`;
22
24
  const orasPushCommand = [
23
25
  `oras push ${ecrRegistry}/${ecrRepository}:${tag}`,
24
- `--annotation "org.opencontainers.image.source=${gitRepoUrl}"`,
25
- `--annotation "org.opencontainers.image.revision=${commitSha}"`,
26
+ ...getOciAnnotations(gitRepoUrl, commitSha, type, tag),
26
27
  `--disable-path-validation`,
27
28
  `--artifact-type ${artifactType} ${artifactPath}`,
28
29
  ].join(' ');
@@ -31,6 +32,23 @@ async function pushImageToEcr(ecrRepository, tag, artifactPath, type, ecrRegistr
31
32
  });
32
33
  consola_1.consola.log(uploadToOci.stdout);
33
34
  }
35
+ /**
36
+ * Get annotations to add to the OCI push command
37
+ * @param gitRepoUrl
38
+ * @param commitSha
39
+ * @param type
40
+ * @param tag
41
+ */
42
+ function getOciAnnotations(gitRepoUrl, commitSha, type, tag) {
43
+ const annotations = [
44
+ `--annotation "org.opencontainers.image.source=${gitRepoUrl}"`,
45
+ `--annotation "org.opencontainers.image.revision=${commitSha}"`,
46
+ ];
47
+ if (type === enums_1.ArtifactType.FRONTEND) {
48
+ annotations.push(`--annotation "payfit.net.frontend.artifact=/${tag}-${commitSha}"`);
49
+ }
50
+ return annotations;
51
+ }
34
52
  /**
35
53
  * Pushes helm chart as OCI artifact to ECR using ORAS.
36
54
  *
@@ -1 +1 @@
1
- {"version":3,"file":"oci.js","sourceRoot":"","sources":["../../../../src/utils/common/oci.ts"],"names":[],"mappings":";;AAeA,wCAwBC;AAYD,4CAwBC;AA3ED,qCAAiC;AAGjC,iCAA6B;AAC7B,qCAAgF;AAEhF;;;;;;;;GAQG;AACI,KAAK,UAAU,cAAc,CAClC,aAAqB,EACrB,GAAW,EACX,YAAoB,EACpB,IAAiD,EACjD,WAAmB;IAEnB,iBAAO,CAAC,GAAG,CACT,8BAA8B,WAAW,IAAI,aAAa,IAAI,GAAG,EAAE,CACpE,CAAA;IACD,MAAM,SAAS,GAAG,MAAM,IAAA,+BAAsB,GAAE,CAAA;IAChD,MAAM,UAAU,GAAG,MAAM,IAAA,sCAA6B,GAAE,CAAA;IACxD,MAAM,YAAY,GAAG,0BAA0B,IAAI,WAAW,CAAA;IAC9D,MAAM,eAAe,GAAG;QACtB,aAAa,WAAW,IAAI,aAAa,IAAI,GAAG,EAAE;QAClD,iDAAiD,UAAU,GAAG;QAC9D,mDAAmD,SAAS,GAAG;QAC/D,2BAA2B;QAC3B,mBAAmB,YAAY,IAAI,YAAY,EAAE;KAClD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACX,MA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AAU,GAAG,MAAM,IAAA,sCAA6B,GAAE,CAAA;IACxD,MAAM,eAAe,GAAG;QACtB,aAAa,WAAW,IAAI,aAAa,IAAI,GAAG,EAAE;QAClD,iDAAiD,UAAU,GAAG;QAC9D,mDAAmD,SAAS,GAAG;QAC/D,2BAA2B;QAC3B,YAAY,eAAe,2CAA2C;QACtE,GAAG,YAAY,sDAAsD;KACtE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACX,MAAM,WAAW,GAAG,MAAM,IAAA,WAAI,EAAC,eAAe,EAAE;QAC9C,YAAY,EAAE,IAAI;KACnB,CAAC,CAAA;IACF,iBAAO,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;AACjC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/nx-core",
3
- "version": "5.3.0",
3
+ "version": "5.3.1-ephemeral-frontend-path-annotation.0",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",