@payfit/nx-core 4.9.1-ephemeral.6 → 4.9.1-ephemeral.7

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.
Files changed (45) hide show
  1. package/dist/README.md +19 -0
  2. package/dist/executors.json +9 -0
  3. package/dist/package.json +23 -0
  4. package/dist/src/executors/publisher/docker.d.ts +5 -0
  5. package/dist/src/executors/publisher/docker.js +18 -0
  6. package/dist/src/executors/publisher/docker.js.map +1 -0
  7. package/dist/src/executors/publisher/executor.d.ts +4 -0
  8. package/dist/src/executors/publisher/executor.js +21 -0
  9. package/dist/src/executors/publisher/executor.js.map +1 -0
  10. package/dist/src/executors/publisher/helm.d.ts +7 -0
  11. package/dist/src/executors/publisher/helm.js +37 -0
  12. package/dist/src/executors/publisher/helm.js.map +1 -0
  13. package/dist/src/executors/publisher/schema.d.ts +5 -0
  14. package/dist/src/executors/publisher/schema.json +18 -0
  15. package/dist/src/index.d.ts +4 -0
  16. package/dist/src/index.js +50 -0
  17. package/dist/src/index.js.map +1 -0
  18. package/dist/src/scripts/version-action.d.ts +25 -0
  19. package/dist/src/scripts/version-action.js +56 -0
  20. package/dist/src/scripts/version-action.js.map +1 -0
  21. package/dist/src/utils/aws-auth.d.ts +39 -0
  22. package/dist/src/utils/aws-auth.js +76 -0
  23. package/dist/src/utils/aws-auth.js.map +1 -0
  24. package/dist/src/utils/docker.d.ts +19 -0
  25. package/dist/src/utils/docker.js +29 -0
  26. package/dist/src/utils/docker.js.map +1 -0
  27. package/dist/src/utils/exec.d.ts +7 -0
  28. package/dist/src/utils/exec.js +21 -0
  29. package/dist/src/utils/exec.js.map +1 -0
  30. package/dist/src/utils/get-version.d.ts +6 -0
  31. package/dist/src/utils/get-version.js +11 -0
  32. package/dist/src/utils/get-version.js.map +1 -0
  33. package/dist/src/utils/github.d.ts +4 -0
  34. package/dist/src/utils/github.js +14 -0
  35. package/dist/src/utils/github.js.map +1 -0
  36. package/dist/src/utils/helm.d.ts +48 -0
  37. package/dist/src/utils/helm.js +83 -0
  38. package/dist/src/utils/helm.js.map +1 -0
  39. package/dist/src/utils/import-esm.d.ts +2 -0
  40. package/dist/src/utils/import-esm.js +8 -0
  41. package/dist/src/utils/import-esm.js.map +1 -0
  42. package/dist/src/utils/tsh.d.ts +10 -0
  43. package/dist/src/utils/tsh.js +99 -0
  44. package/dist/src/utils/tsh.js.map +1 -0
  45. package/package.json +3 -2
package/dist/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # nx-core package
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Usage
6
+
7
+ Install the package as dev dependency of your project:
8
+
9
+ ```shell
10
+ yarn add -D @payfit/nx-core
11
+ ```
12
+
13
+ ## Building
14
+
15
+ Run `nx build nx-core` to build the library.
16
+
17
+ ## Running unit tests
18
+
19
+ Run `nx test nx-core` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -0,0 +1,9 @@
1
+ {
2
+ "executors": {
3
+ "publisher": {
4
+ "implementation": "./src/executors/publisher/executor",
5
+ "schema": "./src/executors/publisher/schema.json",
6
+ "description": "Docker & Helm publisher executor"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@payfit/nx-core",
3
+ "version": "0.0.0-use.local",
4
+ "type": "commonjs",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "dependencies": {
8
+ "@nx/devkit": "21.0.1",
9
+ "get-port": "^7.1.0",
10
+ "ky": "^1.8.1",
11
+ "nx": "21.0.1",
12
+ "semver": "7.7.1",
13
+ "tinyexec": "0.3.2",
14
+ "tslib": "^2.8.1",
15
+ "yaml": "^2.7.0",
16
+ "zod": "^3.24.3"
17
+ },
18
+ "executors": "./executors.json",
19
+ "files": [
20
+ "dist",
21
+ "!**/*.tsbuildinfo"
22
+ ]
23
+ }
@@ -0,0 +1,5 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { PublisherExecutorOptions } from './schema';
3
+ export declare function publishDocker(options: PublisherExecutorOptions, context: ExecutorContext, version: string): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -0,0 +1,18 @@
1
+ import * as fs from 'node:fs';
2
+ import { join } from 'path';
3
+ import { checkAwsAuth, loginToEcr, pushImageToEcr } from '../../utils/aws-auth';
4
+ import { buildDockerImage } from '../../utils/docker';
5
+ export async function publishDocker(options, context, version) {
6
+ await checkAwsAuth();
7
+ await loginToEcr();
8
+ const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
9
+ const projectDockerfile = join(projectRoot, 'Dockerfile');
10
+ if (!fs.existsSync(projectDockerfile)) {
11
+ throw new Error('Dockerfile not found in project root');
12
+ }
13
+ console.log('Building docker image with version ' + version);
14
+ await buildDockerImage(options.ecrRegistry, projectDockerfile, version);
15
+ console.log(`Publishing docker image to ${options.ecrRegistry} with version ${version}`);
16
+ return await pushImageToEcr(options.ecrRegistry, version);
17
+ }
18
+ //# sourceMappingURL=docker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docker.js","sourceRoot":"","sources":["../../../../src/executors/publisher/docker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAiC,EACjC,OAAwB,EACxB,OAAe;IAIf,MAAM,YAAY,EAAE,CAAA;IACpB,MAAM,UAAU,EAAE,CAAA;IAElB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAA;IACnE,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;IAEzD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACzD,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,qCAAqC,GAAG,OAAO,CAAC,CAAA;IAC5D,MAAM,gBAAgB,CAAC,OAAO,CAAC,WAAW,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAA;IAEvE,OAAO,CAAC,GAAG,CACT,8BAA8B,OAAO,CAAC,WAAW,iBAAiB,OAAO,EAAE,CAC5E,CAAA;IACD,OAAO,MAAM,cAAc,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;AAC3D,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { PublisherExecutorOptions, PublisherExecutorSchema } from './schema';
3
+ declare const runExecutor: (options: PublisherExecutorOptions, context: ExecutorContext) => Promise<PublisherExecutorSchema>;
4
+ export default runExecutor;
@@ -0,0 +1,21 @@
1
+ import { getVersion } from '../../utils/get-version';
2
+ import { publishDocker } from './docker';
3
+ import { publishHelm } from './helm';
4
+ const runExecutor = async (options, context) => {
5
+ try {
6
+ const version = getVersion(context.projectName);
7
+ await publishDocker(options, context, version);
8
+ await publishHelm(options, context, version);
9
+ }
10
+ catch (error) {
11
+ console.error(error);
12
+ return {
13
+ success: false,
14
+ };
15
+ }
16
+ return {
17
+ success: true,
18
+ };
19
+ };
20
+ export default runExecutor;
21
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../src/executors/publisher/executor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAGpC,MAAM,WAAW,GAGuB,KAAK,EAC3C,OAAiC,EACjC,OAAwB,EACxB,EAAE;IACF,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAC/C,MAAM,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;QAC9C,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,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,eAAe,WAAW,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { PublisherExecutorOptions } from './schema';
3
+ export declare function publishHelm(options: PublisherExecutorOptions, context: ExecutorContext, version: string): Promise<{
4
+ success: boolean;
5
+ stdout: any;
6
+ stderr: any;
7
+ }>;
@@ -0,0 +1,37 @@
1
+ import { __addDisposableResource, __disposeResources } from "tslib";
2
+ import * as fs from 'node:fs';
3
+ import { checkAwsAuth } from '../../utils/aws-auth';
4
+ import { getSanitizedCurrentGitBranch } from '../../utils/github';
5
+ import { installHelmRepo, packageHelm, pushPackagedHelm, resetTeleportProxyHelmChartFile, setupTeleportProxyHelmChartFile, } from '../../utils/helm';
6
+ import { getLocalPortForChartMuseum } from '../../utils/tsh';
7
+ export async function publishHelm(options, context, version) {
8
+ const env_1 = { stack: [], error: void 0, hasError: false };
9
+ try {
10
+ const projectHelmFolder = `apps/${context.projectName}/.deploy`;
11
+ const destinationHelmFolder = `dist/apps/${context.projectName}/chart/`;
12
+ const gitBranchName = await getSanitizedCurrentGitBranch();
13
+ if (!gitBranchName)
14
+ throw new Error('Unable to get current Git branch');
15
+ await checkAwsAuth();
16
+ if (!fs.existsSync(projectHelmFolder)) {
17
+ throw new Error(`.deploy folder not found for project ${context.projectName}`);
18
+ }
19
+ console.log(`Publishing Helm chart to ${options.chartRegistry}/${gitBranchName} with version ${version}`);
20
+ // connect to the chartmuseum through teleport
21
+ const proxyData = __addDisposableResource(env_1, await getLocalPortForChartMuseum(), false);
22
+ await proxyData.isReady();
23
+ await setupTeleportProxyHelmChartFile(projectHelmFolder, proxyData.port);
24
+ await installHelmRepo(projectHelmFolder);
25
+ await packageHelm(projectHelmFolder, version, destinationHelmFolder);
26
+ await resetTeleportProxyHelmChartFile(projectHelmFolder, proxyData.port);
27
+ return pushPackagedHelm(`${destinationHelmFolder}${context.projectName}-${version}.tgz`, options.chartRegistry, gitBranchName);
28
+ }
29
+ catch (e_1) {
30
+ env_1.error = e_1;
31
+ env_1.hasError = true;
32
+ }
33
+ finally {
34
+ __disposeResources(env_1);
35
+ }
36
+ }
37
+ //# sourceMappingURL=helm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helm.js","sourceRoot":"","sources":["../../../../src/executors/publisher/helm.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAI7B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,EACL,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAG5D,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAiC,EACjC,OAAwB,EACxB,OAAe;;;QAMf,MAAM,iBAAiB,GAAG,QAAQ,OAAO,CAAC,WAAW,UAAU,CAAA;QAC/D,MAAM,qBAAqB,GAAG,aAAa,OAAO,CAAC,WAAW,SAAS,CAAA;QACvE,MAAM,aAAa,GAAG,MAAM,4BAA4B,EAAE,CAAA;QAE1D,IAAI,CAAC,aAAa;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;QAEvE,MAAM,YAAY,EAAE,CAAA;QAEpB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CACb,wCAAwC,OAAO,CAAC,WAAW,EAAE,CAC9D,CAAA;QACH,CAAC;QACD,OAAO,CAAC,GAAG,CACT,4BAA4B,OAAO,CAAC,aAAa,IAAI,aAAa,iBAAiB,OAAO,EAAE,CAC7F,CAAA;QACD,8CAA8C;QAC9C,MAAM,SAAS,kCAAG,MAAM,0BAA0B,EAAE,QAAA,CAAA;QACpD,MAAM,SAAS,CAAC,OAAO,EAAE,CAAA;QAEzB,MAAM,+BAA+B,CAAC,iBAAiB,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;QACxE,MAAM,eAAe,CAAC,iBAAiB,CAAC,CAAA;QACxC,MAAM,WAAW,CAAC,iBAAiB,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAA;QACpE,MAAM,+BAA+B,CAAC,iBAAiB,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;QACxE,OAAO,gBAAgB,CACrB,GAAG,qBAAqB,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,MAAM,EAC/D,OAAO,CAAC,aAAa,EACrB,aAAa,CACd,CAAA;;;;;;;;;CACF"}
@@ -0,0 +1,5 @@
1
+ export interface PublisherExecutorSchema {} // eslint-disable-line
2
+ export interface PublisherExecutorOptions {
3
+ chartRegistry: string
4
+ ecrRegistry: string
5
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "Publisher executor",
5
+ "description": "Publish the helm chart to the chartmuseum and docker image to ECR",
6
+ "type": "object",
7
+ "properties": {
8
+ "chartRegistry": {
9
+ "type": "string",
10
+ "description": "The helm chart registry"
11
+ },
12
+ "ecrRegistry": {
13
+ "type": "string",
14
+ "description": "The docker registry"
15
+ }
16
+ },
17
+ "required": []
18
+ }
@@ -0,0 +1,4 @@
1
+ import { CreateNodesV2 } from '@nx/devkit';
2
+ export interface MyPluginOptions {
3
+ }
4
+ export declare const createNodesV2: CreateNodesV2<MyPluginOptions>;
@@ -0,0 +1,50 @@
1
+ import { existsSync } from 'fs';
2
+ import { dirname, join } from 'path';
3
+ import { createNodesFromFiles, readJsonFile, } from '@nx/devkit';
4
+ export const createNodesV2 = [
5
+ '**/project.json',
6
+ async (configFiles, options, context) => {
7
+ return await createNodesFromFiles((configFile, options, context) => createNodesInternal(configFile, options, context), configFiles, options, context);
8
+ },
9
+ ];
10
+ async function createNodesInternal(configFilePath, options, context) {
11
+ const projectConfiguration = readJsonFile(configFilePath);
12
+ const projectRoot = dirname(configFilePath);
13
+ const isDockerProject = existsSync(join(projectRoot, 'Dockerfile'));
14
+ const isHelmProject = existsSync(join(projectRoot, '.deploy/Chart.yaml'));
15
+ const targets = {};
16
+ const ecrRegistry = isDockerProject
17
+ ? projectConfiguration.metadata &&
18
+ projectConfiguration.metadata['ecrRepository']
19
+ : undefined;
20
+ const chartRegistry = isHelmProject
21
+ ? projectConfiguration.metadata &&
22
+ projectConfiguration.metadata['chartRegistry']
23
+ : undefined;
24
+ if (isHelmProject || isDockerProject) {
25
+ const publisherConfig = readJsonFile(join(__dirname, '/executors/publisher/schema.json'));
26
+ targets['nx-release-publish'] = {
27
+ executor: '@payfit/nx-core:publisher',
28
+ options: {
29
+ ecrRegistry,
30
+ chartRegistry,
31
+ },
32
+ cache: true,
33
+ inputs: ['production', '^production'],
34
+ outputs: [`{workspaceRoot}/dist/apps/${projectConfiguration.name}/chart`],
35
+ metadata: {
36
+ technologies: ['helm', 'docker'],
37
+ description: publisherConfig.description,
38
+ },
39
+ };
40
+ }
41
+ return {
42
+ projects: {
43
+ [projectRoot]: {
44
+ ...projectConfiguration,
45
+ targets,
46
+ },
47
+ },
48
+ };
49
+ }
50
+ //# sourceMapp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;QAChD,CAAC,CAAC,SAAS,CAAA;IAEb,IAAI,aAAa,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,eAAe,GAAG,YAAY,CAClC,IAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC,CACpD,CAAA;QACD,OAAO,CAAC,oBAAoB,CAAC,GAAG;YAC9B,QAAQ,EAAE,2BAA2B;YACrC,OAAO,EAAE;gBACP,WAAW;gBACX,aAAa;aACd;YACD,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;YACrC,OAAO,EAAE,CAAC,6BAA6B,oBAAoB,CAAC,IAAI,QAAQ,CAAC;YACzE,QAAQ,EAAE;gBACR,YAAY,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;gBAChC,WAAW,EAAE,eAAe,CAAC,WAAW;aACzC;SACF,CAAA;IACH,CAAC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,CAAC,WAAW,CAAC,EAAE;gBACb,GAAG,oBAAoB;gBACvB,OAAO;aACR;SACF;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { ProjectGraph, Tree } from '@nx/devkit';
2
+ import { VersionActions } from 'nx/release';
3
+ import { NxReleaseVersionConfiguration } from 'nx/src/config/nx-json';
4
+ export default class customVersionAction extends VersionActions {
5
+ validManifestFilenames: string[];
6
+ readCurrentVersionFromSourceManifest(tree: Tree): Promise<{
7
+ currentVersion: string;
8
+ manifestPath: string;
9
+ } | null>;
10
+ readCurrentVersionFromRegistry(tree: Tree, currentVersionResolverMetadata: NxReleaseVersionConfiguration['currentVersionResolverMetadata']): Promise<{
11
+ currentVersion: string | null;
12
+ logText: string;
13
+ } | null>;
14
+ readCurrentVersionOfDependency(tree: Tree, projectGraph: ProjectGraph, dependencyProjectName: string): Promise<{
15
+ currentVersion: string | null;
16
+ dependencyCollection: string | null;
17
+ }>;
18
+ isLocalDependencyProtocol(versionSpecifier: string): Promise<boolean>;
19
+ updateProjectVersion(tree: Tree, newVersion: string): Promise<string[]>;
20
+ updateProjectDependencies(tree: Tree, projectGraph: ProjectGraph, dependenciesToUpdate: Record<string, string>): Promise<string[]>;
21
+ calculateNewVersion(currentVersion: string | null, newVersionInput: string, newVersionInputReason: string, newVersionInputReasonData: Record<string, unknown>, preid: string): Promise<{
22
+ newVersion: string;
23
+ logText: string;
24
+ }>;
25
+ }
@@ -0,0 +1,56 @@
1
+ import { VersionActions } from 'nx/release';
2
+ import { inc } from 'semver';
3
+ export default class customVersionAction extends VersionActions {
4
+ validManifestFilenames;
5
+ async readCurrentVersionFromSourceManifest(tree) {
6
+ return {
7
+ currentVersion: '0.0.0',
8
+ manifestPath: 'apps/my-nest-app/project.json',
9
+ };
10
+ }
11
+ async readCurrentVersionFromRegistry(tree, currentVersionResolverMetadata) {
12
+ return {
13
+ currentVersion: '0.0.0',
14
+ logText: 'Current version from registry',
15
+ };
16
+ }
17
+ async readCurrentVersionOfDependency(tree, projectGraph, dependencyProjectName) {
18
+ return {
19
+ currentVersion: '0.0.0',
20
+ dependencyCollection: '0.0.0',
21
+ };
22
+ }
23
+ async isLocalDependencyProtocol(versionSpecifier) {
24
+ return false;
25
+ }
26
+ async updateProjectVersion(tree, newVersion) {
27
+ // Update the version in the VERSION file
28
+ const currentProject = this.projectGraphNode.name;
29
+ const versionFilePath = `dist/apps/${currentProject}/VERSION`;
30
+ tree.write(versionFilePath, newVersion);
31
+ return [];
32
+ }
33
+ async updateProjectDependencies(tree, projectGraph, dependenciesToUpdate) {
34
+ return [];
35
+ }
36
+ async calculateNewVersion(currentVersion, newVersionInput, newVersionInputReason, newVersionInputReasonData, preid) {
37
+ function formatDate() {
38
+ const date = new Date();
39
+ const year = date.getFullYear();
40
+ const month = String(date.getMonth() + 1).padStart(2, '0'); // getMonth() returns 0-11
41
+ const day = date.getDate();
42
+ return `${year}${month}.${day}.`;
43
+ }
44
+ function getNewVersionFromCurrentVersion(currentVersion) {
45
+ const expectedPattern = formatDate();
46
+ return !currentVersion.startsWith(expectedPattern)
47
+ ? `${expectedPattern}0`
48
+ : inc(currentVersion, 'patch');
49
+ }
50
+ return {
51
+ newVersion: getNewVersionFromCurrentVersion(currentVersion),
52
+ logText: `New version: ${getNewVersionFromCurrentVersion(currentVersion)}`,
53
+ };
54
+ }
55
+ }
56
+ //# sourceMappingURL=version-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-action.js","sourceRoot":"","sources":["../../../src/scripts/version-action.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,cAAc;IAC7D,sBAAsB,CAAU;IAChC,KAAK,CAAC,oCAAoC,CACxC,IAAU;QAEV,OAAO;YACL,cAAc,EAAE,OAAO;YACvB,YAAY,EAAE,+BAA+B;SAC9C,CAAA;IACH,CAAC;IACD,KAAK,CAAC,8BAA8B,CAClC,IAAU,EACV,8BAA+F;QAE/F,OAAO;YACL,cAAc,EAAE,OAAO;YACvB,OAAO,EAAE,+BAA+B;SACzC,CAAA;IACH,CAAC;IACD,KAAK,CAAC,8BAA8B,CAClC,IAAU,EACV,YAA0B,EAC1B,qBAA6B;QAK7B,OAAO;YACL,cAAc,EAAE,OAAO;YACvB,oBAAoB,EAAE,OAAO;SAC9B,CAAA;IACH,CAAC;IACD,KAAK,CAAC,yBAAyB,CAAC,gBAAwB;QACtD,OAAO,KAAK,CAAA;IACd,CAAC;IACD,KAAK,CAAC,oBAAoB,CACxB,IAAU,EACV,UAAkB;QAElB,yCAAyC;QACzC,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAA;QACjD,MAAM,eAAe,GAAG,aAAa,cAAc,UAAU,CAAA;QAC7D,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;QACvC,OAAO,EAAE,CAAA;IACX,CAAC;IACD,KAAK,CAAC,yBAAyB,CAC7B,IAAU,EACV,YAA0B,EAC1B,oBAA4C;QAE5C,OAAO,EAAE,CAAA;IACX,CAAC;IACD,KAAK,CAAC,mBAAmB,CACvB,cAA6B,EAC7B,eAAuB,EACvB,qBAA6B,EAC7B,yBAAkD,EAClD,KAAa;QAKb,SAAS,UAAU;YACjB,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;YACvB,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;YAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA,CAAC,0BAA0B;YACrF,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;YAE1B,OAAO,GAAG,IAAI,GAAG,KAAK,IAAI,GAAG,GAAG,CAAA;QAClC,CAAC;QAED,SAAS,+BAA+B,CAAC,cAAsB;YAC7D,MAAM,eAAe,GAAG,UAAU,EAAE,CAAA;YACpC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,eAAe,CAAC;gBAChD,CAAC,CAAC,GAAG,eAAe,GAAG;gBACvB,CAAC,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;QAClC,CAAC;QAED,OAAO;YACL,UAAU,EAAE,+BAA+B,CAAC,cAAc,CAAC;YAC3D,OAAO,EAAE,gBAAgB,+BAA+B,CAAC,cAAc,CAAC,EAAE;SAC3E,CAAA;IACH,CAAC;CACF"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Return the AWS profile name to use in AWS cli commands
3
+ */
4
+ export declare function getProfileName(): string;
5
+ /**
6
+ * Retrieves the AWS credentials from environment variables.
7
+ * Ensures that `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_DEFAULT_REGION` are properly set.
8
+ * Throws an error if credentials or region are missing.
9
+ *
10
+ * @return {Object} An object containing AWS credentials.
11
+ * @return {string} return.accessKeyId The AWS Access Key ID.
12
+ * @return {string} return.secretAccessKey The AWS Secret Access Key.
13
+ * @return {string} return.region The AWS Region.
14
+ */
15
+ export declare function getAwsCredentialsSet(): {
16
+ accessKeyId: string;
17
+ secretAccessKey: string;
18
+ region: string;
19
+ };
20
+ /**
21
+ * Retrieves the authentication information for a given OIDC profile.
22
+ * If the specified profile exists, it fetches the configuration; otherwise, it returns false.
23
+ *
24
+ * @return {Promise<string | boolean>} The authentication details if the profile exists, or false if the profile does not exist.
25
+ */
26
+ export declare function getAuthWithOidcProfile(): Promise<string | boolean>;
27
+ export declare function loginToEcr(): Promise<{
28
+ success: boolean;
29
+ stdout: string;
30
+ stderr: string;
31
+ }>;
32
+ /**
33
+ * Check AWS CLI with the OIDC profile otherwise use the default credentials
34
+ * @returns {string} the profile's name
35
+ */
36
+ export declare function checkAwsAuth(): Promise<string>;
37
+ export declare function pushImageToEcr(repositoryName: string, version: string): Promise<{
38
+ success: boolean;
39
+ }>;
@@ -0,0 +1,76 @@
1
+ import { getDockerOrPodman } from './docker';
2
+ import { exec_command } from './exec';
3
+ let profileName = 'OIDC-PROFILE';
4
+ /**
5
+ * Return the AWS profile name to use in AWS cli commands
6
+ */
7
+ export function getProfileName() {
8
+ return profileName;
9
+ }
10
+ /**
11
+ * Retrieves the AWS credentials from environment variables.
12
+ * Ensures that `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_DEFAULT_REGION` are properly set.
13
+ * Throws an error if credentials or region are missing.
14
+ *
15
+ * @return {Object} An object containing AWS credentials.
16
+ * @return {string} return.accessKeyId The AWS Access Key ID.
17
+ * @return {string} return.secretAccessKey The AWS Secret Access Key.
18
+ * @return {string} return.region The AWS Region.
19
+ */
20
+ export function getAwsCredentialsSet() {
21
+ const accessKeyId = process.env.AWS_ACCESS_KEY_ID;
22
+ const secretAccessKey = process.env.AWS_SECRET_ACCESS_KEY;
23
+ const region = process.env.AWS_DEFAULT_REGION;
24
+ if (!accessKeyId || !secretAccessKey) {
25
+ throw new Error('AWS credentials not found, please set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables (or attach GLOBAL_ORG context if you are using CircleCI)');
26
+ }
27
+ if (!region) {
28
+ throw new Error('AWS region not found, please set AWS_DEFAULT_REGION environment variable (or attach GLOBAL_ORG context if you are using CircleCI)');
29
+ }
30
+ return { accessKeyId, secretAccessKey, region };
31
+ }
32
+ /**
33
+ * Retrieves the authentication information for a given OIDC profile.
34
+ * If the specified profile exists, it fetches the configuration; otherwise, it returns false.
35
+ *
36
+ * @return {Promise<string | boolean>} The authentication details if the profile exists, or false if the profile does not exist.
37
+ */
38
+ export async function getAuthWithOidcProfile() {
39
+ try {
40
+ const profileExist = await exec_command(`aws configure list-profiles | grep ${profileName}`);
41
+ if (profileExist.success) {
42
+ return profileExist.stdout;
43
+ }
44
+ return false;
45
+ }
46
+ catch (e) {
47
+ console.error(e);
48
+ return false;
49
+ }
50
+ }
51
+ export async function loginToEcr() {
52
+ return exec_command(`aws ecr get-login-password --profile ${profileName} --region eu-west-3 | ${await getDockerOrPodman()} login --username AWS --password-stdin ${process.env.AWS_ECR_REGISTRY}`);
53
+ }
54
+ /**
55
+ * Check AWS CLI with the OIDC profile otherwise use the default credentials
56
+ * @returns {string} the profile's name
57
+ */
58
+ export async function checkAwsAuth() {
59
+ const profileExist = await getAuthWithOidcProfile();
60
+ if (profileExist) {
61
+ console.log('OIDC profile found, using it');
62
+ profileName = 'OIDC-PROFILE';
63
+ }
64
+ else if (getAwsCredentialsSet()) {
65
+ console.log('OIDC profile not found, using AWS_KEY_ID and AWS_SECRET_ACCESS_KEY');
66
+ profileName = 'default';
67
+ }
68
+ else {
69
+ throw new Error('AWS credentials not found, please attach CORE-PLATFORM_SHARED_ENV context if you are using CircleCI or export AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables');
70
+ }
71
+ return profileName;
72
+ }
73
+ export function pushImageToEcr(repositoryName, version) {
74
+ return exec_command(`docker push ${process.env.AWS_ECR_REGISTRY}/${repositoryName}:${version}`);
75
+ }
76
+ //# sourceMappingURL=aws-auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aws-auth.js","sourceRoot":"","sources":["../../../src/utils/aws-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAErC,IAAI,WAAW,GAAG,cAAc,CAAA;AAEhC;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,WAAW,CAAA;AACpB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB;IAKlC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAA;IACjD,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAA;IACzD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAA;IAC7C,IAAI,CAAC,WAAW,IAAI,CAAC,eAAe,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,kKAAkK,CACnK,CAAA;IACH,CAAC;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,mIAAmI,CACpI,CAAA;IACH,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,CAAA;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAC1C,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,MAAM,YAAY,CACrC,sCAAsC,WAAW,EAAE,CACpD,CAAA;QACD,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YACzB,OAAO,YAAY,CAAC,MAAM,CAAA;QAC5B,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAChB,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,OAAO,YAAY,CACjB,wCAAwC,WAAW,yBAAyB,MAAM,iBAAiB,EAAE,0CAA0C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAC9K,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,YAAY,GAAG,MAAM,sBAAsB,EAAE,CAAA;IACnD,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;QAC3C,WAAW,GAAG,cAAc,CAAA;IAC9B,CAAC;SAAM,IAAI,oBAAoB,EAAE,EAAE,CAAC;QAClC,OAAO,CAAC,GAAG,CACT,oEAAoE,CACrE,CAAA;QACD,WAAW,GAAG,SAAS,CAAA;IACzB,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,iLAAiL,CAClL,CAAA;IACH,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,cAAsB,EACtB,OAAe;IAEf,OAAO,YAAY,CACjB,eAAe,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,cAAc,IAAI,OAAO,EAAE,CAC3E,CAAA;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Determines the available container management tool by checking for Docker and fallback to Podman if Docker is unavailable.
3
+ *
4
+ * @return {Promise<string>} A promise that resolves to the string 'docker' if Docker is available, or 'podman' if Podman is used as a fallback.
5
+ */
6
+ export declare function getDockerOrPodman(): Promise<string>;
7
+ /**
8
+ * Builds a Docker image using the provided Dockerfile.
9
+ *
10
+ * @param imageName The name of the image to build.
11
+ * @param dockerfilePath The path to the Dockerfile.
12
+ * @param version The version of the image to build.
13
+ * @return {Promise<{success: boolean, stdout: string, stderr: string}>} A promise that resolves to an object containing the success status, stdout, and stderr of the command.
14
+ */
15
+ export declare function buildDockerImage(imageName: string, dockerfilePath: string, version: string): Promise<{
16
+ success: boolean;
17
+ stdout: string;
18
+ stderr: string;
19
+ }>;
@@ -0,0 +1,29 @@
1
+ import { exec_command } from './exec';
2
+ /**
3
+ * Determines the available container management tool by checking for Docker and fallback to Podman if Docker is unavailable.
4
+ *
5
+ * @return {Promise<string>} A promise that resolves to the string 'docker' if Docker is available, or 'podman' if Podman is used as a fallback.
6
+ */
7
+ export async function getDockerOrPodman() {
8
+ try {
9
+ await exec_command('docker --version');
10
+ return 'docker';
11
+ }
12
+ catch (e) {
13
+ console.log('docker not found, trying podman');
14
+ return 'podman';
15
+ }
16
+ }
17
+ /**
18
+ * Builds a Docker image using the provided Dockerfile.
19
+ *
20
+ * @param imageName The name of the image to build.
21
+ * @param dockerfilePath The path to the Dockerfile.
22
+ * @param version The version of the image to build.
23
+ * @return {Promise<{success: boolean, stdout: string, stderr: string}>} A promise that resolves to an object containing the success status, stdout, and stderr of the command.
24
+ */
25
+ export async function buildDockerImage(imageName, dockerfilePath, version) {
26
+ const dockerOrPodman = await getDockerOrPodman();
27
+ return exec_command(`${dockerOrPodman} buildx build -t ${process.env.AWS_ECR_REGISTRY}/${imageName}:${version} -f ${dockerfilePath} --secret id=NPM_TOKEN .`);
28
+ }
29
+ //# sourceMappingURL=docker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docker.js","sourceRoot":"","sources":["../../../src/utils/docker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAErC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,IAAI,CAAC;QACH,MAAM,YAAY,CAAC,kBAAkB,CAAC,CAAA;QACtC,OAAO,QAAQ,CAAA;IACjB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAA;QAC9C,OAAO,QAAQ,CAAA;IACjB,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,SAAiB,EACjB,cAAsB,EACtB,OAAe;IAEf,MAAM,cAAc,GAAG,MAAM,iBAAiB,EAAE,CAAA;IAChD,OAAO,YAAY,CACjB,GAAG,cAAc,oBAAoB,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,SAAS,IAAI,OAAO,OAAO,cAAc,2BAA2B,CAC1I,CAAA;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { TinyExec } from 'tinyexec';
2
+ export declare function exec_command(command: string): Promise<{
3
+ success: boolean;
4
+ stdout: string;
5
+ stderr: string;
6
+ }>;
7
+ export declare const execTiny: TinyExec;
@@ -0,0 +1,21 @@
1
+ import { exec } from 'child_process';
2
+ import { promisify } from 'util';
3
+ import { x } from 'tinyexec';
4
+ export async function exec_command(command) {
5
+ const { stdout, stderr } = await promisify(exec)(command);
6
+ console.log(stdout);
7
+ console.error(stderr);
8
+ const success = !stderr;
9
+ return { success, stdout, stderr };
10
+ }
11
+ function createLoggingExecWrapper(execFn) {
12
+ return (command, args = [], options = {}) => {
13
+ console.log(`Running '${command} ${args.join(' ')}'...`);
14
+ return execFn(command, args, {
15
+ throwOnError: true,
16
+ ...options,
17
+ });
18
+ };
19
+ }
20
+ export const execTiny = createLoggingExecWrapper(x);
21
+ //# sourceMappingURL=exec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../src/utils/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAIhC,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAA;AAE5B,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAe;IAChD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAA;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACnB,OAAO,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,OAAO,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;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get the version of a project
3
+ * @param projectName
4
+ * @returns {string}
5
+ */
6
+ export declare function getVersion(projectName: string): string;
@@ -0,0 +1,11 @@
1
+ import * as fs from 'node:fs';
2
+ /**
3
+ * Get the version of a project
4
+ * @param projectName
5
+ * @returns {string}
6
+ */
7
+ export function getVersion(projectName) {
8
+ const versionFilePath = `dist/apps/${projectName}/VERSION`;
9
+ return fs.readFileSync(versionFilePath, 'utf8');
10
+ }
11
+ //# sourceMappingURL=get-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-version.js","sourceRoot":"","sources":["../../../src/utils/get-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7B;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,WAAmB;IAC5C,MAAM,eAAe,GAAG,aAAa,WAAW,UAAU,CAAA;IAC1D,OAAO,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;AACjD,CAAC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Get sanitized current git branch name
3
+ */
4
+ export declare function getSanitizedCurrentGitBranch(): Promise<string>;
@@ -0,0 +1,14 @@
1
+ import { exec_command } from './exec';
2
+ /**
3
+ * Get sanitized current git branch name
4
+ */
5
+ export async function getSanitizedCurrentGitBranch() {
6
+ const branchName = await exec_command(`git branch --show-current`);
7
+ return branchName.success
8
+ ? branchName.stdout
9
+ .trim()
10
+ .toLowerCase()
11
+ .replace(/[^a-z0-9]/g, '')
12
+ : '';
13
+ }
14
+ //# sourceMappingURL=github.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.js","sourceRoot":"","sources":["../../../src/utils/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAErC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B;IAChD,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,2BAA2B,CAAC,CAAA;IAClE,OAAO,UAAU,CAAC,OAAO;QACvB,CAAC,CAAC,UAAU,CAAC,MAAM;aACd,IAAI,EAAE;aACN,WAAW,EAAE;aACb,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;QAC9B,CAAC,CAAC,EAAE,CAAA;AACR,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Read & parse the Helm chart.yaml file
3
+ * @param helmFolderPath
4
+ */
5
+ export declare function getHelmChartFile(helmFolderPath: string): Promise<any>;
6
+ /**
7
+ * Prepare the Chart.yaml config file for the Tsh proxy
8
+ * @param helmFolderPath
9
+ * @param tshPort
10
+ */
11
+ export declare function setupTeleportProxyHelmChartFile(helmFolderPath: string, tshPort: number): Promise<void>;
12
+ /**
13
+ * Revert the Tsh proxy config in the Chart.yaml config file
14
+ * @param helmFolderPath
15
+ * @param tshPort
16
+ */
17
+ export declare function resetTeleportProxyHelmChartFile(helmFolderPath: string, tshPort: number): Promise<void>;
18
+ /**
19
+ * Install all the helm repositories defined in the Chart config
20
+ * @param helmFolderPath
21
+ */
22
+ export declare function installHelmRepo(helmFolderPath: string): Promise<{
23
+ success: boolean;
24
+ stdout: string;
25
+ stderr: string;
26
+ }>;
27
+ /**
28
+ * Package the Helm chart
29
+ * @param helmFolderPath
30
+ * @param version
31
+ * @param destinationPath
32
+ */
33
+ export declare function packageHelm(helmFolderPath: string, version: string, destinationPath: string): Promise<{
34
+ success: boolean;
35
+ stdout: string;
36
+ stderr: string;
37
+ }>;
38
+ /**
39
+ * Push the packaged Helm chart in the chartmuseum
40
+ * @param packagedHelmChartFilePath
41
+ * @param projectName
42
+ * @param branch
43
+ */
44
+ export declare function pushPackagedHelm(packagedHelmChartFilePath: string, projectName: string, branch: string): Promise<{
45
+ success: boolean;
46
+ stdout: string;
47
+ stderr: string;
48
+ }>;
@@ -0,0 +1,83 @@
1
+ import * as fs from 'node:fs';
2
+ import * as process from 'node:process';
3
+ import { parse, stringify } from 'yaml';
4
+ import { getProfileName } from './aws-auth';
5
+ import { exec_command } from './exec';
6
+ const tshProxy = 'http://localhost';
7
+ /**
8
+ * Read & parse the Helm chart.yaml file
9
+ * @param helmFolderPath
10
+ */
11
+ export async function getHelmChartFile(helmFolderPath) {
12
+ return parse(fs.readFileSync(`${helmFolderPath}/Chart.yaml`, 'utf8'));
13
+ }
14
+ /**
15
+ * Prepare the Chart.yaml config file for the Tsh proxy
16
+ * @param helmFolderPath
17
+ * @param tshPort
18
+ */
19
+ export async function setupTeleportProxyHelmChartFile(helmFolderPath, tshPort) {
20
+ console.log(`Replacing charts.shared.payfit.tech -> localhost:${tshPort} for the Teleport proxy`);
21
+ let chartConfigStr = stringify(await getHelmChartFile(helmFolderPath));
22
+ chartConfigStr = chartConfigStr.replace(/(https?:\/\/)charts(\.shared)?\.payfit\.tech/gi, `${tshProxy}:${tshPort}`);
23
+ return fs.writeFileSync(`${helmFolderPath}/Chart.yaml`, chartConfigStr);
24
+ }
25
+ /**
26
+ * Revert the Tsh proxy config in the Chart.yaml config file
27
+ * @param helmFolderPath
28
+ * @param tshPort
29
+ */
30
+ export async function resetTeleportProxyHelmChartFile(helmFolderPath, tshPort) {
31
+ let chartConfigStr = stringify(await getHelmChartFile(helmFolderPath));
32
+ chartConfigStr = chartConfigStr.replace(`${tshProxy}:${tshPort}`, 'https://charts.shared.payfit.tech');
33
+ return fs.writeFileSync(`${helmFolderPath}/Chart.yaml`, chartConfigStr);
34
+ }
35
+ /**
36
+ * Install all the helm repositories defined in the Chart config
37
+ * @param helmFolderPath
38
+ */
39
+ export async function installHelmRepo(helmFolderPath) {
40
+ const chartConfig = await getHelmChartFile(helmFolderPath);
41
+ if (chartConfig.dependencies) {
42
+ for (let i = 0; i < chartConfig.dependencies.length; i++) {
43
+ const dep = chartConfig.dependencies[i];
44
+ const repoName = `tsh-${dep.name}-${dep.alias}`;
45
+ // check if the repository is our private payfit repo or a public one
46
+ if (dep.repository.includes(tshProxy)) {
47
+ // if it's our repo, we need the username and password to authenticate
48
+ if (!process.env.CHARTMUSEUM_USERNAME ||
49
+ !process.env.CHARTMUSEUM_PASSWORD)
50
+ throw new Error('Missing CHARTMUSEUM_USERNAME, CHARTMUSEUM_PASSWORD in environment!');
51
+ await exec_command(`helm repo add --username '${process.env.CHARTMUSEUM_USERNAME}' --password '${process.env.CHARTMUSEUM_PASSWORD}' '${repoName}' '${dep.repository}' --force-update`);
52
+ }
53
+ else {
54
+ await exec_command(`helm repo add '${repoName}' '${dep.repository}' --force-update`);
55
+ }
56
+ await exec_command(`helm repo update ${repoName}`);
57
+ }
58
+ }
59
+ return exec_command(`helm dependency update ${helmFolderPath}`);
60
+ }
61
+ /**
62
+ * Package the Helm chart
63
+ * @param helmFolderPath
64
+ * @param version
65
+ * @param destinationPath
66
+ */
67
+ export async function packageHelm(helmFolderPath, version, destinationPath) {
68
+ return exec_command(`helm package ${helmFolderPath} --version ${version} --destination ${destinationPath}`);
69
+ }
70
+ /**
71
+ * Push the packaged Helm chart in the chartmuseum
72
+ * @param packagedHelmChartFilePath
73
+ * @param projectName
74
+ * @param branch
75
+ */
76
+ export async function pushPackagedHelm(packagedHelmChartFilePath, projectName, branch) {
77
+ if (!process.env.CHARTMUSEUM_BUCKET_NAME)
78
+ throw new Error('Missing CHARTMUSEUM_BUCKET_NAME in environment!');
79
+ // aws s3api put-object-tagging --bucket ${process.env.CHARTMUSEUM_BUCKET_NAME} --key ${projectName}/${branch}/${packagedHelmChartFilePath} --tagging '{"TagSet": [{ "Key": "auto-purge", "Value": "false" }]}' // todo
80
+ const profile = getProfileName() === 'default' ? '' : `--profile ${getProfileName()}`;
81
+ return exec_command(`aws s3 cp ${profile} --sse AES256 ${packagedHelmChartFilePath} s3://${process.env.CHARTMUSEUM_BUCKET_NAME}/${projectName}/${branch}/`);
82
+ }
83
+ //# sourceMappingURL=helm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helm.js","sourceRoot":"","sources":["../../../src/utils/helm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAErC,MAAM,QAAQ,GAAG,kBAAkB,CAAA;AAEnC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,cAAsB;IAC3D,OAAO,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,cAAc,aAAa,EAAE,MAAM,CAAC,CAAC,CAAA;AACvE,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,cAAsB,EACt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@@ -0,0 +1,2 @@
1
+ export declare function importKy(): Promise<typeof import('ky')>;
2
+ export declare function importGetPort(): Promise<typeof import('get-port')>;
@@ -0,0 +1,8 @@
1
+ // Needed since we have to have dynamic import to esm module, since we are stuck with cjs on the nx tool runner
2
+ export function importKy() {
3
+ return Function('return import("ky")')();
4
+ }
5
+ export function importGetPort() {
6
+ return Function('return import("get-port")')();
7
+ }
8
+ //# sourceMappingURL=import-esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-esm.js","sourceRoot":"","sources":["../../../src/utils/import-esm.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,MAAM,UAAU,QAAQ;IACtB,OAAO,QAAQ,CAAC,qBAAqB,CAAC,EAAkC,CAAA;AAC1E,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,QAAQ,CAAC,2BAA2B,CAAC,EAE3C,CAAA;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare function isLoggedInToTsh(): Promise<boolean>;
2
+ export declare function ensureIsLoggedInToTsh(): Promise<boolean>;
3
+ export declare function isConnectedToChartMuseum(): Promise<boolean>;
4
+ export declare function ensureAppIsChartMuseum(): Promise<boolean>;
5
+ export declare const getLocalPortForChartMuseum: () => Promise<{
6
+ [Symbol.dispose]: () => Promise<void>;
7
+ fetchClient: import("ky").KyInstance;
8
+ isReady: () => Promise<boolean>;
9
+ port: number;
10
+ }>;
@@ -0,0 +1,99 @@
1
+ import { workspaceRoot } from 'nx/src/utils/workspace-root';
2
+ import { z } from 'zod';
3
+ import { execTiny } from './exec';
4
+ import { importGetPort, importKy } from './import-esm';
5
+ const expectedProfileUrl = 'https://payfit.teleport.sh:443';
6
+ const expectedAppName = 'charts-shared';
7
+ const profile = z.object({
8
+ profile_url: z.string(),
9
+ });
10
+ const statusSchema = z.object({
11
+ active: profile,
12
+ profiles: z.array(profile).optional(),
13
+ });
14
+ const getStatusOfTsh = async () => {
15
+ const { stdout } = await execTiny('tsh', `status -f json`.split(' '));
16
+ return statusSchema.parse(JSON.parse(stdout));
17
+ };
18
+ export async function isLoggedInToTsh() {
19
+ try {
20
+ const status = await getStatusOfTsh();
21
+ return status.active.profile_url === expectedProfileUrl;
22
+ }
23
+ catch {
24
+ return false;
25
+ }
26
+ }
27
+ export async function ensureIsLoggedInToTsh() {
28
+ if (await isLoggedInToTsh()) {
29
+ return true;
30
+ }
31
+ await execTiny('tsh', `login --proxy=${expectedProfileUrl} --auth=okta`.split(' '), {
32
+ throwOnError: true,
33
+ });
34
+ return await isLoggedInToTsh();
35
+ }
36
+ const getAppConfigOfTsh = async () => {
37
+ const { stdout } = await execTiny('tsh', `apps config -f json --proxy=${expectedProfileUrl} ${expectedAppName}`.split(' '), {
38
+ throwOnError: true,
39
+ });
40
+ return JSON.parse(stdout);
41
+ };
42
+ export async function isConnectedToChartMuseum() {
43
+ try {
44
+ const apps = await getAppConfigOfTsh();
45
+ return apps.name === expectedAppName;
46
+ }
47
+ catch {
48
+ return false;
49
+ }
50
+ }
51
+ export async function ensureAppIsChartMuseum() {
52
+ if (await isConnectedToChartMuseum()) {
53
+ return true;
54
+ }
55
+ await execTiny('tsh', `apps login ${expectedAppName} --proxy=${expectedProfileUrl}`.split(' '), {
56
+ throwOnError: true,
57
+ });
58
+ return await isConnectedToChartMuseum();
59
+ }
60
+ export const getLocalPortForChartMuseum = async () => {
61
+ if (!process.env.CI) {
62
+ await ensureIsLoggedInToTsh();
63
+ await ensureAppIsChartMuseum();
64
+ }
65
+ const { default: getPort } = await importGetPort();
66
+ const { default: ky } = await importKy();
67
+ const port = await getPort();
68
+ const command = process.env.CI
69
+ ? `-i ./certs/identity --proxy payfit.teleport.sh:443 proxy app ${expectedAppName} --port ${port}`
70
+ : `proxy app ${expectedAppName} -p ${port}`;
71
+ const execHandle = execTiny('tsh', command.split(' '), {
72
+ nodeOptions: {
73
+ cwd: workspaceRoot,
74
+ },
75
+ });
76
+ const isReady = async () => {
77
+ for await (const line of execHandle) {
78
+ console.log(`[TSH] ${line}`);
79
+ if (line.includes('Proxying connections')) {
80
+ return true;
81
+ }
82
+ }
83
+ // line will be from stderr/stdout in the order you'd see it in a term
84
+ return false;
85
+ };
86
+ const fetchClient = ky.create({
87
+ prefixUrl: `http://localhost:${port}`,
88
+ });
89
+ return {
90
+ [Symbol.dispose]: async () => {
91
+ console.log(`Terminating tsh proxy on port ${port}`);
92
+ execHandle.kill();
93
+ },
94
+ fetchClient,
95
+ isReady,
96
+ port,
97
+ };
98
+ };
99
+ //# sourceMappingURL=tsh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsh.js","sourceRoot":"","sources":["../../../src/utils/tsh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEtD,MAAM,kBAAkB,GAAG,gCAAgC,CAAA;AAC3D,MAAM,eAAe,GAAG,eAAe,CAAA;AAEvC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,MAAM,EAAE,OAAO;IACf,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE;IAChC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;IACrE,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;A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AC;QAC5B,SAAS,EAAE,oBAAoB,IAAI,EAAE;KACtC,CAAC,CAAA;IAEF,OAAO;QACL,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,EAAE;YAC3B,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,EAAE,CAAC,CAAA;YACpD,UAAU,CAAC,IAAI,EAAE,CAAA;QACnB,CAAC;QACD,WAAW;QACX,OAAO;QACP,IAAI;KACL,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/nx-core",
3
- "version": "4.9.1-ephemeral.6",
3
+ "version": "4.9.1-ephemeral.7",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "executors": "./executors.json",
19
19
  "files": [
20
- "dist"
20
+ "dist",
21
+ "!**/*.tsbuildinfo"
21
22
  ]
22
23
  }