@payfit/nx-core 4.19.1-ephemeral-fix-hard-coded-paths.3 → 4.19.1-ephemeral-fix-hard-coded-paths.4
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 +2 -1
- package/src/executors/publisher/docker.js +9 -5
- package/src/executors/publisher/docker.js.map +1 -1
- package/src/executors/publisher/executor.js +2 -1
- package/src/executors/publisher/executor.js.map +1 -1
- package/src/executors/publisher/helm.js +8 -4
- package/src/executors/publisher/helm.js.map +1 -1
- package/src/utils/exec.js +4 -3
- package/src/utils/exec.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/nx-core",
|
|
3
|
-
"version": "4.19.1-ephemeral-fix-hard-coded-paths.
|
|
3
|
+
"version": "4.19.1-ephemeral-fix-hard-coded-paths.4",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"directory": "packages/nx-core"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
+
"consola": "^3.4.2",
|
|
14
15
|
"get-port": "^7.1.0",
|
|
15
16
|
"ky": "^1.8.1",
|
|
16
17
|
"semver": "7.7.2",
|
|
@@ -2,19 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.publishDocker = publishDocker;
|
|
4
4
|
const fs = require("node:fs");
|
|
5
|
+
const consola_1 = require("consola");
|
|
5
6
|
const aws_auth_1 = require("../../utils/aws-auth");
|
|
6
7
|
const docker_1 = require("../../utils/docker");
|
|
7
8
|
const github_1 = require("../../utils/github");
|
|
8
9
|
async function publishDocker(options, context, version, projectRoot) {
|
|
9
|
-
await (0, aws_auth_1.checkAwsAuth)();
|
|
10
|
-
await (0, aws_auth_1.loginToEcr)();
|
|
11
10
|
const projectDockerfile = `${projectRoot}/Dockerfile`;
|
|
12
11
|
if (!fs.existsSync(projectDockerfile)) {
|
|
13
|
-
|
|
12
|
+
consola_1.consola.warn(`Dockerfile not found at ${projectDockerfile}, soft failing`);
|
|
13
|
+
return {
|
|
14
|
+
success: true,
|
|
15
|
+
};
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
await (0, aws_auth_1.checkAwsAuth)();
|
|
18
|
+
await (0, aws_auth_1.loginToEcr)();
|
|
19
|
+
consola_1.consola.log('Building docker image with version ' + version);
|
|
16
20
|
await (0, docker_1.buildDockerImage)(options.ecrRegistry, projectDockerfile, version, await (0, github_1.getSanitizedCurrentGitRepoUrl)(), await (0, github_1.getCurrentGitCommitSha)());
|
|
17
|
-
|
|
21
|
+
consola_1.consola.log(`Publishing docker image to ${options.ecrRegistry} with version ${version}`);
|
|
18
22
|
return await (0, aws_auth_1.pushImageToEcr)(options.ecrRegistry, version);
|
|
19
23
|
}
|
|
20
24
|
//# sourceMappingURL=docker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker.js","sourceRoot":"","sources":["../../../../../../packages/nx-core/src/executors/publisher/docker.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"docker.js","sourceRoot":"","sources":["../../../../../../packages/nx-core/src/executors/publisher/docker.ts"],"names":[],"mappings":";;AAaA,sCAiCC;AA9CD,8BAA6B;AAG7B,qCAAiC;AAEjC,mDAA+E;AAC/E,+CAAqD;AACrD,+CAG2B;AAGpB,KAAK,UAAU,aAAa,CACjC,OAAiC,EACjC,OAAwB,EACxB,OAAe,EACf,WAAmB;IAInB,MAAM,iBAAiB,GAAG,GAAG,WAAW,aAAa,CAAA;IAErD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACtC,iBAAO,CAAC,IAAI,CAAC,2BAA2B,iBAAiB,gBAAgB,CAAC,CAAA;QAC1E,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAA;IACH,CAAC;IAED,MAAM,IAAA,uBAAY,GAAE,CAAA;IACpB,MAAM,IAAA,qBAAU,GAAE,CAAA;IAElB,iBAAO,CAAC,GAAG,CAAC,qCAAqC,GAAG,OAAO,CAAC,CAAA;IAC5D,MAAM,IAAA,yBAAgB,EACpB,OAAO,CAAC,WAAW,EACnB,iBAAiB,EACjB,OAAO,EACP,MAAM,IAAA,sCAA6B,GAAE,EACrC,MAAM,IAAA,+BAAsB,GAAE,CAC/B,CAAA;IAED,iBAAO,CAAC,GAAG,CACT,8BAA8B,OAAO,CAAC,WAAW,iBAAiB,OAAO,EAAE,CAC5E,CAAA;IACD,OAAO,MAAM,IAAA,yBAAc,EAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;AAC3D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const consola_1 = require("consola");
|
|
3
4
|
const nx_1 = require("../../utils/nx");
|
|
4
5
|
const docker_1 = require("./docker");
|
|
5
6
|
const helm_1 = require("./helm");
|
|
@@ -13,7 +14,7 @@ const runExecutor = async (options, context) => {
|
|
|
13
14
|
await (0, helm_1.publishHelm)(options, context, version, projectRoot, projectDist);
|
|
14
15
|
}
|
|
15
16
|
catch (error) {
|
|
16
|
-
|
|
17
|
+
consola_1.consola.error(error);
|
|
17
18
|
return {
|
|
18
19
|
success: false,
|
|
19
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-core/src/executors/publisher/executor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-core/src/executors/publisher/executor.ts"],"names":[],"mappings":";;AACA,qCAAiC;AAEjC,uCAA+E;AAC/E,qCAAwC;AACxC,iCAAoC;AAGpC,MAAM,WAAW,GAGuB,KAAK,EAC3C,OAAiC,EACjC,OAAwB,EACxB,EAAE;IACF,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,IAAA,wBAAmB,EAAC,OAAO,CAAC,CAAA;QACjD,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAA;QAC1C,MAAM,WAAW,GAAG,MAAM,IAAA,kBAAa,EAAC,YAAY,CAAC,CAAA;QACrD,MAAM,OAAO,GAAG,IAAA,eAAU,EAAC,WAAW,CAAC,CAAA;QACvC,MAAM,IAAA,sBAAa,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,CAAA;QAC3D,MAAM,IAAA,kBAAW,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;IACxE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iBAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO;YACL,OAAO,EAAE,KAAK;SACf,CAAA;IACH,CAAC;IACD,OAAO;QACL,OAAO,EAAE,IAAI;KACd,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.publishHelm = publishHelm;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs = require("node:fs");
|
|
6
|
+
const consola_1 = require("consola");
|
|
6
7
|
const aws_auth_1 = require("../../utils/aws-auth");
|
|
7
8
|
const github_1 = require("../../utils/github");
|
|
8
9
|
const helm_1 = require("../../utils/helm");
|
|
@@ -17,11 +18,14 @@ async function publishHelm(options, context, version, projectRoot, projectDist)
|
|
|
17
18
|
const gitBranchName = await (0, github_1.getSanitizedCurrentGitBranch)();
|
|
18
19
|
if (!gitBranchName)
|
|
19
20
|
throw new Error('Unable to get current Git branch');
|
|
20
|
-
await (0, aws_auth_1.checkAwsAuth)();
|
|
21
21
|
if (!fs.existsSync(projectHelmFolder)) {
|
|
22
|
-
|
|
22
|
+
consola_1.consola.warn(`.deploy folder not found at ${projectHelmFolder}, soft failing`);
|
|
23
|
+
return {
|
|
24
|
+
success: true,
|
|
25
|
+
};
|
|
23
26
|
}
|
|
24
|
-
|
|
27
|
+
await (0, aws_auth_1.checkAwsAuth)();
|
|
28
|
+
consola_1.consola.log(`Publishing Helm chart to ${options.chartRegistry}/${gitBranchName} with version ${version}`);
|
|
25
29
|
// connect to the chartmuseum through teleport
|
|
26
30
|
const proxyData = tslib_1.__addDisposableResource(env_1, await (0, tsh_1.getLocalPortForChartMuseum)(), false);
|
|
27
31
|
await proxyData.isReady();
|
|
@@ -35,7 +39,7 @@ async function publishHelm(options, context, version, projectRoot, projectDist)
|
|
|
35
39
|
const packagedHelmChartPath = `${destinationHelmFolder}${packagedHelmChartName}`;
|
|
36
40
|
// If ociEcrRegistry is provided, push to ECR using OCI format
|
|
37
41
|
if (options.ociEcrRegistry) {
|
|
38
|
-
|
|
42
|
+
consola_1.consola.log(`Publishing Helm chart to OCI registry ${options.ociEcrRegistry}`);
|
|
39
43
|
return (0, helm_1.pushOciPackagedHelm)(packagedHelmChartPath, options.ociEcrRegistry);
|
|
40
44
|
}
|
|
41
45
|
// Otherwise, push to the chartmuseum as before
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helm.js","sourceRoot":"","sources":["../../../../../../packages/nx-core/src/executors/publisher/helm.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"helm.js","sourceRoot":"","sources":["../../../../../../packages/nx-core/src/executors/publisher/helm.ts"],"names":[],"mappings":";;AAoBA,kCAgEC;;AApFD,8BAA6B;AAG7B,qCAAiC;AAEjC,mDAAmD;AACnD,+CAAiE;AACjE,2CASyB;AACzB,yCAA4D;AAGrD,KAAK,UAAU,WAAW,CAC/B,OAAiC,EACjC,OAAwB,EACxB,OAAe,EACf,WAAmB,EACnB,WAAmB;;;QAInB,MAAM,iBAAiB,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GAAG,WAAW,CAAC,IAAI,IAAI,OAAO,MAAM,CAAA;QAClE,MAAM,qBAAqB,GAAG,GAAG,qBAAqB,GAAG,qBAAqB,EAAE,CAAA;QAEhF,8DAA8D;QAC9D,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;YAC3B,iBAAO,CAAC,GAAG,CACT,yCAAyC,OAAO,CAAC,cAAc,EAAE,CAClE,CAAA;YACD,OAAO,IAAA,0BAAmB,EAAC,qBAAqB,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;QAC3E,CAAC;QAED,+CAA+C;QAC/C,MAAM,IAAA,uBAAgB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,OAAO,CAAC,aAAa,EACrB,aAAa,CACd,CAAA;QAED,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAA;;;;;;;;;CACF"}
|
package/src/utils/exec.js
CHANGED
|
@@ -4,17 +4,18 @@ exports.execTiny = void 0;
|
|
|
4
4
|
exports.exec_command = exec_command;
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
6
|
const util_1 = require("util");
|
|
7
|
+
const consola_1 = require("consola");
|
|
7
8
|
const tinyexec_1 = require("tinyexec");
|
|
8
9
|
async function exec_command(command) {
|
|
9
10
|
const { stdout, stderr } = await (0, util_1.promisify)(child_process_1.exec)(command);
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
consola_1.consola.log(stdout);
|
|
12
|
+
consola_1.consola.error(stderr);
|
|
12
13
|
const success = !stderr;
|
|
13
14
|
return { success, stdout, stderr };
|
|
14
15
|
}
|
|
15
16
|
function createLoggingExecWrapper(execFn) {
|
|
16
17
|
return (command, args = [], options = {}) => {
|
|
17
|
-
|
|
18
|
+
consola_1.consola.log(`Running '${command} ${args.join(' ')}'...`);
|
|
18
19
|
return execFn(command, args, {
|
|
19
20
|
throwOnError: true,
|
|
20
21
|
...options,
|
package/src/utils/exec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../../../packages/nx-core/src/utils/exec.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../../../packages/nx-core/src/utils/exec.ts"],"names":[],"mappings":";;;AAQA,oCAOC;AAfD,iDAAoC;AACpC,+BAAgC;AAIhC,qCAAiC;AACjC,uCAA4B;AAErB,KAAK,UAAU,YAAY,CAAC,OAAe;IAChD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC,OAAO,CAAC,CAAA;IACzD,iBAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACnB,iBAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAErB,MAAM,OAAO,GAAG,CAAC,MAAM,CAAA;IACvB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AACpC,CAAC;AAED,SAAS,wBAAwB,CAAC,MAAgB;IAChD,OAAO,CACL,OAAe,EACf,OAAiB,EAAE,EACnB,UAA4B,EAAE,EAC9B,EAAE;QACF,iBAAO,CAAC,GAAG,CAAC,YAAY,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACxD,OAAO,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE;YAC3B,YAAY,EAAE,IAAI;YAClB,GAAG,OAAO;SACX,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC;AAEY,QAAA,QAAQ,GAAG,wBAAwB,CAAC,YAAC,CAAC,CAAA"}
|