@payfit/nx-core 0.0.0-e2e
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/README.md +173 -0
- package/dist/src/codegen.d.ts +3 -0
- package/dist/src/codegen.js +25 -0
- package/dist/src/codegen.js.map +1 -0
- package/dist/src/executors/preview-deploy/README.md +5 -0
- package/dist/src/executors/preview-deploy/argocdOverride.d.ts +4 -0
- package/dist/src/executors/preview-deploy/argocdOverride.js +22 -0
- package/dist/src/executors/preview-deploy/argocdOverride.js.map +1 -0
- package/dist/src/executors/preview-deploy/executor.d.ts +4 -0
- package/dist/src/executors/preview-deploy/executor.js +143 -0
- package/dist/src/executors/preview-deploy/executor.js.map +1 -0
- package/dist/src/executors/preview-deploy/kargoPolicy.d.ts +14 -0
- package/dist/src/executors/preview-deploy/kargoPolicy.js +69 -0
- package/dist/src/executors/preview-deploy/kargoPolicy.js.map +1 -0
- package/dist/src/executors/preview-deploy/schema.json +28 -0
- package/dist/src/executors/publisher/README.md +3 -0
- package/dist/src/executors/publisher/docker.d.ts +3 -0
- package/dist/src/executors/publisher/docker.js +66 -0
- package/dist/src/executors/publisher/docker.js.map +1 -0
- package/dist/src/executors/publisher/executor.d.ts +4 -0
- package/dist/src/executors/publisher/executor.js +20 -0
- package/dist/src/executors/publisher/executor.js.map +1 -0
- package/dist/src/executors/publisher/helm.d.ts +3 -0
- package/dist/src/executors/publisher/helm.js +69 -0
- package/dist/src/executors/publisher/helm.js.map +1 -0
- package/dist/src/executors/publisher/lambda.d.ts +18 -0
- package/dist/src/executors/publisher/lambda.js +86 -0
- package/dist/src/executors/publisher/lambda.js.map +1 -0
- package/dist/src/executors/publisher/schema.json +62 -0
- package/dist/src/executors/release/README.md +15 -0
- package/dist/src/executors/release/executor.d.ts +4 -0
- package/dist/src/executors/release/executor.js +104 -0
- package/dist/src/executors/release/executor.js.map +1 -0
- package/dist/src/executors/release/schema.json +37 -0
- package/dist/src/generators/init/README.md +5 -0
- package/dist/src/generators/init/files/.circleci/config.yml.template +232 -0
- package/dist/src/generators/init/files/.circleci/teleport/shared-charts.conf.template +24 -0
- package/dist/src/generators/init/files/.npmrc.template +1 -0
- package/dist/src/generators/init/init.d.ts +13 -0
- package/dist/src/generators/init/init.js +278 -0
- package/dist/src/generators/init/init.js.map +1 -0
- package/dist/src/generators/init/schema.json +7 -0
- package/dist/src/index.d.ts +27 -0
- package/dist/src/index.js +118 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/scripts/codegen-with-auth.js +55 -0
- package/dist/src/scripts/version-actions.d.ts +8 -0
- package/dist/src/scripts/version-actions.js +41 -0
- package/dist/src/scripts/version-actions.js.map +1 -0
- package/dist/src/scripts/version-actions.mock.d.ts +6 -0
- package/dist/src/scripts/version-actions.mock.js +61 -0
- package/dist/src/scripts/version-actions.mock.js.map +1 -0
- package/dist/src/utils/common/aws-auth.d.ts +47 -0
- package/dist/src/utils/common/aws-auth.js +145 -0
- package/dist/src/utils/common/aws-auth.js.map +1 -0
- package/dist/src/utils/common/circleci.d.ts +2 -0
- package/dist/src/utils/common/circleci.js +20 -0
- package/dist/src/utils/common/circleci.js.map +1 -0
- package/dist/src/utils/common/exec.d.ts +4 -0
- package/dist/src/utils/common/exec.js +52 -0
- package/dist/src/utils/common/exec.js.map +1 -0
- package/dist/src/utils/common/github.d.ts +20 -0
- package/dist/src/utils/common/github.js +60 -0
- package/dist/src/utils/common/github.js.map +1 -0
- package/dist/src/utils/common/import-esm.d.ts +2 -0
- package/dist/src/utils/common/import-esm.js +12 -0
- package/dist/src/utils/common/import-esm.js.map +1 -0
- package/dist/src/utils/common/logger.d.ts +1 -0
- package/dist/src/utils/common/logger.js +8 -0
- package/dist/src/utils/common/logger.js.map +1 -0
- package/dist/src/utils/common/nx.d.ts +22 -0
- package/dist/src/utils/common/nx.js +174 -0
- package/dist/src/utils/common/nx.js.map +1 -0
- package/dist/src/utils/common/s3.d.ts +1 -0
- package/dist/src/utils/common/s3.js +18 -0
- package/dist/src/utils/common/s3.js.map +1 -0
- package/dist/src/utils/common/tsh.d.ts +11 -0
- package/dist/src/utils/common/tsh.js +112 -0
- package/dist/src/utils/common/tsh.js.map +1 -0
- package/dist/src/utils/datadog.d.ts +1 -0
- package/dist/src/utils/datadog.js +33 -0
- package/dist/src/utils/datadog.js.map +1 -0
- package/dist/src/utils/docker.d.ts +15 -0
- package/dist/src/utils/docker.js +73 -0
- package/dist/src/utils/docker.js.map +1 -0
- package/dist/src/utils/helm.d.ts +64 -0
- package/dist/src/utils/helm.js +159 -0
- package/dist/src/utils/helm.js.map +1 -0
- package/dist/src/utils/helm.mock.d.ts +85 -0
- package/dist/src/utils/helm.mock.js +100 -0
- package/dist/src/utils/helm.mock.js.map +1 -0
- package/dist/src/utils/lambda/aws-lambda.d.ts +47 -0
- package/dist/src/utils/lambda/aws-lambda.js +231 -0
- package/dist/src/utils/lambda/aws-lambda.js.map +1 -0
- package/dist/src/utils/lambda/lambda.d.ts +7 -0
- package/dist/src/utils/lambda/lambda.js +20 -0
- package/dist/src/utils/lambda/lambda.js.map +1 -0
- package/dist/src/utils/lambda/oci.d.ts +8 -0
- package/dist/src/utils/lambda/oci.js +22 -0
- package/dist/src/utils/lambda/oci.js.map +1 -0
- package/dist/src/utils/lambda/publish.d.ts +14 -0
- package/dist/src/utils/lambda/publish.js +44 -0
- package/dist/src/utils/lambda/publish.js.map +1 -0
- package/dist/src/utils/lambda/spacelift.d.ts +3 -0
- package/dist/src/utils/lambda/spacelift.js +55 -0
- package/dist/src/utils/lambda/spacelift.js.map +1 -0
- package/dist/src/utils/spacelift/lib/__generated__/fragment-masking.d.ts +19 -0
- package/dist/src/utils/spacelift/lib/__generated__/fragment-masking.js +22 -0
- package/dist/src/utils/spacelift/lib/__generated__/fragment-masking.js.map +1 -0
- package/dist/src/utils/spacelift/lib/__generated__/gql.d.ts +15 -0
- package/dist/src/utils/spacelift/lib/__generated__/gql.js +8 -0
- package/dist/src/utils/spacelift/lib/__generated__/gql.js.map +1 -0
- package/dist/src/utils/spacelift/lib/__generated__/graphql.d.ts +9426 -0
- package/dist/src/utils/spacelift/lib/__generated__/graphql.js +819 -0
- package/dist/src/utils/spacelift/lib/__generated__/graphql.js.map +1 -0
- package/dist/src/utils/spacelift/lib/__generated__/index.d.ts +2 -0
- package/dist/src/utils/spacelift/lib/__generated__/index.js +6 -0
- package/dist/src/utils/spacelift/lib/__generated__/index.js.map +1 -0
- package/dist/src/utils/spacelift/lib/graphql.service.d.ts +18 -0
- package/dist/src/utils/spacelift/lib/graphql.service.js +186 -0
- package/dist/src/utils/spacelift/lib/graphql.service.js.map +1 -0
- package/dist/src/utils/spacelift/lib/query/spacelift.queries.d.ts +34 -0
- package/dist/src/utils/spacelift/lib/query/spacelift.queries.js +48 -0
- package/dist/src/utils/spacelift/lib/query/spacelift.queries.js.map +1 -0
- package/dist/src/utils/spacelift/lib/spacelift.error.d.ts +43 -0
- package/dist/src/utils/spacelift/lib/spacelift.error.js +63 -0
- package/dist/src/utils/spacelift/lib/spacelift.error.js.map +1 -0
- package/dist/src/utils/spacelift/lib/spacelift.service.d.ts +16 -0
- package/dist/src/utils/spacelift/lib/spacelift.service.js +58 -0
- package/dist/src/utils/spacelift/lib/spacelift.service.js.map +1 -0
- package/dist/src/utils/spacelift/lib/utils.d.ts +4 -0
- package/dist/src/utils/spacelift/lib/utils.js +32 -0
- package/dist/src/utils/spacelift/lib/utils.js.map +1 -0
- package/executors.json +19 -0
- package/generators.json +9 -0
- package/package.json +60 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mockFinalConfig = exports.mockReleaseGroup = exports.mockProjectGraphNode = void 0;
|
|
4
|
+
exports.mockProjectGraphNode = {
|
|
5
|
+
name: 'test-project',
|
|
6
|
+
type: 'app',
|
|
7
|
+
data: {
|
|
8
|
+
root: 'apps/test-project',
|
|
9
|
+
targets: {
|
|
10
|
+
build: {
|
|
11
|
+
executor: '@nx/js:tsc',
|
|
12
|
+
outputs: ['{options.outputPath}'],
|
|
13
|
+
options: {
|
|
14
|
+
outputPath: 'dist/apps/test-project',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
exports.mockReleaseGroup = {
|
|
21
|
+
name: 'test-group',
|
|
22
|
+
projects: ['test-project'],
|
|
23
|
+
version: {
|
|
24
|
+
useLegacyVersioning: false,
|
|
25
|
+
conventionalCommits: true,
|
|
26
|
+
preVersionCommand: '',
|
|
27
|
+
specifierSource: 'conventional-commits',
|
|
28
|
+
manifestRootsToUpdate: [],
|
|
29
|
+
versionActions: '@payfit/nx-core/versionActions',
|
|
30
|
+
currentVersionResolver: 'git-tag',
|
|
31
|
+
currentVersionResolverMetadata: {},
|
|
32
|
+
fallbackCurrentVersionResolver: 'disk',
|
|
33
|
+
versionPrefix: '',
|
|
34
|
+
preserveLocalDependencyProtocols: false,
|
|
35
|
+
versionActionsOptions: {},
|
|
36
|
+
firstRelease: false,
|
|
37
|
+
deleteVersionPlans: true,
|
|
38
|
+
updateDependents: 'auto',
|
|
39
|
+
groupPreVersionCommand: '',
|
|
40
|
+
logUnchangedProjects: true,
|
|
41
|
+
},
|
|
42
|
+
resolvedVersionPlans: [],
|
|
43
|
+
changelog: false,
|
|
44
|
+
projectsRelationship: 'independent',
|
|
45
|
+
releaseTagPattern: '{projectName}@v{version}',
|
|
46
|
+
releaseTagPatternCheckAllBranchesWhen: false,
|
|
47
|
+
releaseTagPatternRequireSemver: false,
|
|
48
|
+
releaseTagPatternStrictPreid: false,
|
|
49
|
+
versionPlans: false,
|
|
50
|
+
};
|
|
51
|
+
exports.mockFinalConfig = {
|
|
52
|
+
specifierSource: 'conventional-commits',
|
|
53
|
+
currentVersionResolver: 'git-tag',
|
|
54
|
+
currentVersionResolverMetadata: {},
|
|
55
|
+
fallbackCurrentVersionResolver: 'disk',
|
|
56
|
+
versionPrefix: '',
|
|
57
|
+
preserveLocalDependencyProtocols: false,
|
|
58
|
+
versionActionsOptions: {},
|
|
59
|
+
manifestRootsToUpdate: [],
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=version-actions.mock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-actions.mock.js","sourceRoot":"","sources":["../../../src/scripts/version-actions.mock.ts"],"names":[],"mappings":";;;AAIa,QAAA,oBAAoB,GAA4B;IAC3D,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,KAAK;IACX,IAAI,EAAE;QACJ,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,OAAO,EAAE,CAAC,sBAAsB,CAAC;gBACjC,OAAO,EAAE;oBACP,UAAU,EAAE,wBAAwB;iBACrC;aACF;SACF;KACF;CACF,CAAA;AAEY,QAAA,gBAAgB,GAAyB;IACpD,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,CAAC,cAAc,CAAC;IAC1B,OAAO,EAAE;QACP,mBAAmB,EAAE,KAAK;QAC1B,mBAAmB,EAAE,IAAI;QACzB,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,sBAAsB;QACvC,qBAAqB,EAAE,EAAE;QACzB,cAAc,EAAE,gCAAgC;QAChD,sBAAsB,EAAE,SAAS;QACjC,8BAA8B,EAAE,EAAE;QAClC,8BAA8B,EAAE,MAAM;QACtC,aAAa,EAAE,EAAE;QACjB,gCAAgC,EAAE,KAAK;QACvC,qBAAqB,EAAE,EAAE;QACzB,YAAY,EAAE,KAAK;QACnB,kBAAkB,EAAE,IAAI;QACxB,gBAAgB,EAAE,MAAM;QACxB,sBAAsB,EAAE,EAAE;QAC1B,oBAAoB,EAAE,IAAI;KAC3B;IACD,oBAAoB,EAAE,EAAE;IACxB,SAAS,EAAE,KAAK;IAChB,oBAAoB,EAAE,aAAa;IACnC,iBAAiB,EAAE,0BAA0B;IAC7C,qCAAqC,EAAE,KAAK;IAC5C,8BAA8B,EAAE,KAAK;IACrC,4BAA4B,EAAE,KAAK;IACnC,YAAY,EAAE,KAAK;CACpB,CAAA;AAEY,QAAA,eAAe,GAA0B;IACpD,eAAe,EAAE,sBAAsB;IACvC,sBAAsB,EAAE,SAAS;IACjC,8BAA8B,EAAE,EAAE;IAClC,8BAA8B,EAAE,MAAM;IACtC,aAAa,EAAE,EAAE;IACjB,gCAAgC,EAAE,KAAK;IACvC,qBAAqB,EAAE,EAAE;IACzB,qBAAqB,EAAE,EAAE;CAC1B,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Result } from 'tinyexec';
|
|
2
|
+
/**
|
|
3
|
+
* Return the AWS profile name to use in AWS cli commands
|
|
4
|
+
*/
|
|
5
|
+
export declare function getProfileName(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves the AWS credentials from environment variables.
|
|
8
|
+
* Ensures that `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_DEFAULT_REGION` are properly set.
|
|
9
|
+
* Throws an error if credentials or region are missing.
|
|
10
|
+
*
|
|
11
|
+
* @return {Object} An object containing AWS credentials.
|
|
12
|
+
* @return {string} return.accessKeyId The AWS Access Key ID.
|
|
13
|
+
* @return {string} return.secretAccessKey The AWS Secret Access Key.
|
|
14
|
+
* @return {string} return.region The AWS Region.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getAwsCredentialsSet(): {
|
|
17
|
+
accessKeyId: string;
|
|
18
|
+
secretAccessKey: string;
|
|
19
|
+
region: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves the authentication information for a given OIDC profile.
|
|
23
|
+
* If the specified profile exists, it fetches the configuration; otherwise, it returns false.
|
|
24
|
+
*
|
|
25
|
+
* @return {Promise<string | boolean>} The authentication details if the profile exists, or false if the profile does not exist.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getAuthWithOidcProfile(): Promise<string | boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Login to ECR using the specified registry or the AWS_ECR_REGISTRY environment variable
|
|
30
|
+
*
|
|
31
|
+
* @param registry
|
|
32
|
+
* @param isPublicRegistry
|
|
33
|
+
* @returns A promise that resolves to the result of the login command
|
|
34
|
+
*/
|
|
35
|
+
export declare function loginToEcr(registry: string, isPublicRegistry?: boolean): Promise<Result>;
|
|
36
|
+
/**
|
|
37
|
+
* Verify that we have valid ECR credentials by checking the Docker config file
|
|
38
|
+
*
|
|
39
|
+
* @param registry The ECR registry to verify credentials for
|
|
40
|
+
* @returns A promise that resolves to true if credentials are valid, false otherwise
|
|
41
|
+
*/
|
|
42
|
+
export declare function verifyEcrCredentials(registry: string): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Check AWS CLI with the OIDC profile otherwise use the default credentials
|
|
45
|
+
* @returns {string} the profile's name
|
|
46
|
+
*/
|
|
47
|
+
export declare function checkAwsAuth(): Promise<string>;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProfileName = getProfileName;
|
|
4
|
+
exports.getAwsCredentialsSet = getAwsCredentialsSet;
|
|
5
|
+
exports.getAuthWithOidcProfile = getAuthWithOidcProfile;
|
|
6
|
+
exports.loginToEcr = loginToEcr;
|
|
7
|
+
exports.verifyEcrCredentials = verifyEcrCredentials;
|
|
8
|
+
exports.checkAwsAuth = checkAwsAuth;
|
|
9
|
+
const fs = require("fs");
|
|
10
|
+
const os = require("os");
|
|
11
|
+
const path = require("path");
|
|
12
|
+
const consola_1 = require("consola");
|
|
13
|
+
const exec_1 = require("./exec");
|
|
14
|
+
let profileName = 'OIDC-PROFILE';
|
|
15
|
+
/**
|
|
16
|
+
* Return the AWS profile name to use in AWS cli commands
|
|
17
|
+
*/
|
|
18
|
+
function getProfileName() {
|
|
19
|
+
return profileName;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves the AWS credentials from environment variables.
|
|
23
|
+
* Ensures that `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_DEFAULT_REGION` are properly set.
|
|
24
|
+
* Throws an error if credentials or region are missing.
|
|
25
|
+
*
|
|
26
|
+
* @return {Object} An object containing AWS credentials.
|
|
27
|
+
* @return {string} return.accessKeyId The AWS Access Key ID.
|
|
28
|
+
* @return {string} return.secretAccessKey The AWS Secret Access Key.
|
|
29
|
+
* @return {string} return.region The AWS Region.
|
|
30
|
+
*/
|
|
31
|
+
function getAwsCredentialsSet() {
|
|
32
|
+
const accessKeyId = process.env.AWS_ACCESS_KEY_ID;
|
|
33
|
+
const secretAccessKey = process.env.AWS_SECRET_ACCESS_KEY;
|
|
34
|
+
const region = process.env.AWS_DEFAULT_REGION;
|
|
35
|
+
if (!accessKeyId || !secretAccessKey) {
|
|
36
|
+
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)');
|
|
37
|
+
}
|
|
38
|
+
if (!region) {
|
|
39
|
+
throw new Error('AWS region not found, please set AWS_DEFAULT_REGION environment variable (or attach GLOBAL_ORG context if you are using CircleCI)');
|
|
40
|
+
}
|
|
41
|
+
return { accessKeyId, secretAccessKey, region };
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves the authentication information for a given OIDC profile.
|
|
45
|
+
* If the specified profile exists, it fetches the configuration; otherwise, it returns false.
|
|
46
|
+
*
|
|
47
|
+
* @return {Promise<string | boolean>} The authentication details if the profile exists, or false if the profile does not exist.
|
|
48
|
+
*/
|
|
49
|
+
async function getAuthWithOidcProfile() {
|
|
50
|
+
try {
|
|
51
|
+
const profileExist = await (0, exec_1.exec)(`aws configure list-profiles`).pipe('grep', [profileName]);
|
|
52
|
+
return profileExist.exitCode == 0 ? profileExist.stdout.trim() : false;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Login to ECR using the specified registry or the AWS_ECR_REGISTRY environment variable
|
|
60
|
+
*
|
|
61
|
+
* @param registry
|
|
62
|
+
* @param isPublicRegistry
|
|
63
|
+
* @returns A promise that resolves to the result of the login command
|
|
64
|
+
*/
|
|
65
|
+
async function loginToEcr(registry, isPublicRegistry = false) {
|
|
66
|
+
if (!registry) {
|
|
67
|
+
throw new Error('No ECR registry provided, please set AWS_ECR_REGISTRY environment variable or pass it as an argument');
|
|
68
|
+
}
|
|
69
|
+
// Default ECR command for the eu-west-3 region
|
|
70
|
+
let ecrCommand = `aws ecr get-login-password --region eu-west-3`;
|
|
71
|
+
// Check if the registry is the public ECR registry, if so, use the public ECR command
|
|
72
|
+
if (isPublicRegistry) {
|
|
73
|
+
ecrCommand = `aws ecr-public get-login-password --region us-east-1`;
|
|
74
|
+
}
|
|
75
|
+
consola_1.consola.log(`Logging in to ECR registry: ${registry}`);
|
|
76
|
+
try {
|
|
77
|
+
const result = await (0, exec_1.exec)(ecrCommand, { throwOnError: true }).pipe(`docker`, `login --username AWS --password-stdin ${registry}`.split(' '));
|
|
78
|
+
consola_1.consola.success(`Successfully logged in to ECR registry: ${registry}`);
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
consola_1.consola.error(`Failed to login to ECR registry: ${registry}`);
|
|
83
|
+
consola_1.consola.error(error);
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Verify that we have valid ECR credentials by checking the Docker config file
|
|
89
|
+
*
|
|
90
|
+
* @param registry The ECR registry to verify credentials for
|
|
91
|
+
* @returns A promise that resolves to true if credentials are valid, false otherwise
|
|
92
|
+
*/
|
|
93
|
+
async function verifyEcrCredentials(registry) {
|
|
94
|
+
if (!registry) {
|
|
95
|
+
consola_1.consola.error('No ECR registry provided for credential verification');
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
consola_1.consola.log(`Verifying ECR credentials for registry: ${registry}`);
|
|
100
|
+
// Docker config file path
|
|
101
|
+
const configPath = path.join(os.homedir(), '.docker', 'config.json');
|
|
102
|
+
// Check if the config file exists
|
|
103
|
+
if (!fs.existsSync(configPath)) {
|
|
104
|
+
consola_1.consola.error('Docker config file not found');
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
// Read and parse the config file
|
|
108
|
+
const configContent = fs.readFileSync(configPath, 'utf8');
|
|
109
|
+
const config = JSON.parse(configContent);
|
|
110
|
+
// Check if the registry is in the auths section
|
|
111
|
+
if (config.auths && config.auths[registry]) {
|
|
112
|
+
consola_1.consola.success(`ECR credentials verified for registry: ${registry}`);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
consola_1.consola.error(`ECR credentials verification failed: No authentication found for ${registry} in the .docker/config.json file`);
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
consola_1.consola.error(`ECR credentials verification failed with unexpected error`);
|
|
122
|
+
consola_1.consola.error(error);
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Check AWS CLI with the OIDC profile otherwise use the default credentials
|
|
128
|
+
* @returns {string} the profile's name
|
|
129
|
+
*/
|
|
130
|
+
async function checkAwsAuth() {
|
|
131
|
+
const profileExist = await getAuthWithOidcProfile();
|
|
132
|
+
if (profileExist) {
|
|
133
|
+
consola_1.consola.log('OIDC profile found, using it');
|
|
134
|
+
profileName = 'OIDC-PROFILE';
|
|
135
|
+
}
|
|
136
|
+
else if (getAwsCredentialsSet()) {
|
|
137
|
+
consola_1.consola.log('OIDC profile not found, using AWS_KEY_ID and AWS_SECRET_ACCESS_KEY');
|
|
138
|
+
profileName = 'default';
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
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');
|
|
142
|
+
}
|
|
143
|
+
return profileName;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=aws-auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-auth.js","sourceRoot":"","sources":["../../../../src/utils/common/aws-auth.ts"],"names":[],"mappings":";;AAcA,wCAEC;AAYD,oDAmBC;AAQD,wDAUC;AASD,gCA8BC;AAQD,oDAqCC;AAMD,oCAgBC;AA3KD,yBAAwB;AACxB,yBAAwB;AACxB,6BAA4B;AAE5B,qCAAiC;AAGjC,iCAA6B;AAE7B,IAAI,WAAW,GAAG,cAAc,CAAA;AAEhC;;GAEG;AACH,SAAgB,cAAc;IAC5B,OAAO,WAAW,CAAA;AACpB,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,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;AACI,KAAK,UAAU,sBAAsB;IAC1C,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,MAAM,IAAA,WAAI,EAAC,6B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AAY,EAAE,CAAC;QACjB,iBAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;QAC3C,WAAW,GAAG,cAAc,CAAA;IAC9B,CAAC;SAAM,IAAI,oBAAoB,EAAE,EAAE,CAAC;QAClC,iBAAO,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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCircleCIRunner = isCircleCIRunner;
|
|
4
|
+
exports.setupCircleCIRunner = setupCircleCIRunner;
|
|
5
|
+
const exec_1 = require("./exec");
|
|
6
|
+
function isCircleCIRunner() {
|
|
7
|
+
return process.env.CIRCLECI === 'true';
|
|
8
|
+
}
|
|
9
|
+
async function setupCircleCIRunner() {
|
|
10
|
+
const gitSetup = `
|
|
11
|
+
git config --global --type bool push.autoSetupRemote true
|
|
12
|
+
git fetch --tags
|
|
13
|
+
`
|
|
14
|
+
.trim()
|
|
15
|
+
.split('\n');
|
|
16
|
+
for await (const line of gitSetup) {
|
|
17
|
+
await (0, exec_1.exec)(line.trim());
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=circleci.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circleci.js","sourceRoot":"","sources":["../../../../src/utils/common/circleci.ts"],"names":[],"mappings":";;AAEA,4CAEC;AAED,kDAUC;AAhBD,iCAA6B;AAE7B,SAAgB,gBAAgB;IAC9B,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAA;AACxC,CAAC;AAEM,KAAK,UAAU,mBAAmB;IACvC,MAAM,QAAQ,GAAG;;;CAGlB;SACI,IAAI,EAAE;SACN,KAAK,CAAC,IAAI,CAAC,CAAA;IACd,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAClC,MAAM,IAAA,WAAI,EAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;IACzB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exec = void 0;
|
|
4
|
+
const args_tokenizer_1 = require("args-tokenizer");
|
|
5
|
+
const tinyexec_1 = require("tinyexec");
|
|
6
|
+
const logger_1 = require("./logger");
|
|
7
|
+
function createLoggingExecWrapper(execFn) {
|
|
8
|
+
return (command, args = [], options = {}) => {
|
|
9
|
+
return execFn(command, args, options);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
// Accepts a single string, splits it, and runs with logging
|
|
13
|
+
function execWrapperFromString(cmd, options = {}) {
|
|
14
|
+
const [command, ...args] = (0, args_tokenizer_1.tokenizeArgs)(cmd);
|
|
15
|
+
const wrappedExec = createLoggingExecWrapper(tinyexec_1.x);
|
|
16
|
+
const result = wrappedExec(command, args, options);
|
|
17
|
+
// Add a then handler to check for errors
|
|
18
|
+
// Use .then() with both success and error handlers
|
|
19
|
+
const processedResult = result.then(
|
|
20
|
+
// Success handler
|
|
21
|
+
output => {
|
|
22
|
+
// Check if the command failed
|
|
23
|
+
if (output.exitCode !== 0) {
|
|
24
|
+
// Log the error to have it visible in the console
|
|
25
|
+
// Throw if requested
|
|
26
|
+
if (options?.throwOnError) {
|
|
27
|
+
logger_1.consola.error(`Command '${cmd}' failed with exit code ${output.exitCode}:\n ${output.stderr}`);
|
|
28
|
+
throw new Error(`Command '${cmd}' failed with exit code ${output.exitCode}:\n ${output.stderr}`);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
logger_1.consola.warn(`Command '${cmd}' failed with exit code ${output.exitCode} :\n ${output.stderr}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return output;
|
|
35
|
+
},
|
|
36
|
+
// Error handler (instead of .catch())
|
|
37
|
+
error => {
|
|
38
|
+
// Don't log here to avoid double logging
|
|
39
|
+
if (options?.throwOnError) {
|
|
40
|
+
logger_1.consola.error(`Command '${cmd}' failed with :\n ${error}`);
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
// If we don't throw, return a rejected promise with the error
|
|
44
|
+
return Promise.reject(error);
|
|
45
|
+
});
|
|
46
|
+
// Create a new object that combines the original result (for OutputApi methods)
|
|
47
|
+
// with the processed promise result (for then/catch behavior)
|
|
48
|
+
const combinedResult = Object.assign(Object.create(Object.getPrototypeOf(result)), result, { then: processedResult.then.bind(processedResult) });
|
|
49
|
+
return combinedResult;
|
|
50
|
+
}
|
|
51
|
+
exports.exec = execWrapperFromString;
|
|
52
|
+
//# sourceMappingURL=exec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../../src/utils/common/exec.ts"],"names":[],"mappings":";;;AAEA,mDAA6C;AAC7C,uCAA4B;AAE5B,qCAAkC;AAElC,SAAS,wBAAwB,CAAC,MAAgB;IAChD,OAAO,CACL,OAAe,EACf,OAAiB,EAAE,EACnB,UAA4B,EAAE,EAC9B,EAAE;QACF,OAAO,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;IACvC,CAAC,CAAA;AACH,CAAC;AAED,4DAA4D;AAC5D,SAAS,qBAAqB,CAC5B,GAAW,EACX,UAA4B,EAAE;IAE9B,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAA,6BAAY,EAAC,GAAG,CAAC,CAAA;IAC5C,MAAM,WAAW,GAAG,wBAAwB,CAAC,YAAC,CAAC,CAAA;IAE/C,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;IAEl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;AACjC,CAAC;AAEY,QAAA,IAAI,GAAG,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get sanitized current git branch name
|
|
3
|
+
*/
|
|
4
|
+
export declare function getSanitizedCurrentGitBranch(): Promise<string>;
|
|
5
|
+
/**
|
|
6
|
+
* Get current commit sha
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCurrentGitCommitSha(): Promise<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Get sanitized current repo url
|
|
11
|
+
*/
|
|
12
|
+
export declare function getSanitizedCurrentGitRepoUrl(): Promise<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Get git repository name from remote origin URL
|
|
15
|
+
*/
|
|
16
|
+
export declare function getGitRepositoryName(): Promise<string | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* Checks if the branch is a default branch
|
|
19
|
+
*/
|
|
20
|
+
export declare function isDefaultBranch(branchName: string): boolean;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSanitizedCurrentGitBranch = getSanitizedCurrentGitBranch;
|
|
4
|
+
exports.getCurrentGitCommitSha = getCurrentGitCommitSha;
|
|
5
|
+
exports.getSanitizedCurrentGitRepoUrl = getSanitizedCurrentGitRepoUrl;
|
|
6
|
+
exports.getGitRepositoryName = getGitRepositoryName;
|
|
7
|
+
exports.isDefaultBranch = isDefaultBranch;
|
|
8
|
+
const exec_1 = require("./exec");
|
|
9
|
+
/**
|
|
10
|
+
* Get sanitized current git branch name
|
|
11
|
+
*/
|
|
12
|
+
async function getSanitizedCurrentGitBranch() {
|
|
13
|
+
const branchName = await (0, exec_1.exec)(`git branch --show-current`);
|
|
14
|
+
return branchName.exitCode == 0
|
|
15
|
+
? branchName.stdout
|
|
16
|
+
.trim()
|
|
17
|
+
.toLowerCase()
|
|
18
|
+
.replace(/[^a-z0-9-]/g, '')
|
|
19
|
+
: '';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get current commit sha
|
|
23
|
+
*/
|
|
24
|
+
async function getCurrentGitCommitSha() {
|
|
25
|
+
const commitSha = await (0, exec_1.exec)(`git rev-parse HEAD`);
|
|
26
|
+
return commitSha.exitCode == 0 ? commitSha.stdout.trim() : '';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get sanitized current repo url
|
|
30
|
+
*/
|
|
31
|
+
async function getSanitizedCurrentGitRepoUrl() {
|
|
32
|
+
const repoUrlExec = await (0, exec_1.exec)(`git config --get remote.origin.url`);
|
|
33
|
+
if (repoUrlExec.exitCode == 0) {
|
|
34
|
+
const repoUrlMatching = repoUrlExec.stdout.match(/github\.com[:/]PayFit\/[^/]+/);
|
|
35
|
+
if (repoUrlMatching && repoUrlMatching.length > 0) {
|
|
36
|
+
return `https://${repoUrlMatching[0].trim().replace(':', '/').replace('.git', '')}`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get git repository name from remote origin URL
|
|
43
|
+
*/
|
|
44
|
+
async function getGitRepositoryName() {
|
|
45
|
+
const repoUrlExec = await (0, exec_1.exec)('git config --get remote.origin.url');
|
|
46
|
+
const repoUrl = repoUrlExec.stdout.trim();
|
|
47
|
+
// Extract repo name from URL (handles both HTTPS and SSH formats)
|
|
48
|
+
const match = repoUrl.match(/\/([^/]+?)(?:\.git)?$/);
|
|
49
|
+
if (match && match[1]) {
|
|
50
|
+
return match[1];
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Checks if the branch is a default branch
|
|
56
|
+
*/
|
|
57
|
+
function isDefaultBranch(branchName) {
|
|
58
|
+
return branchName === 'main' || branchName === 'master';
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=github.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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AAED;;GAEG;AACI,KAAK,UAAU,oBAAoB;IACxC,MAAM,WAAW,GAAG,MAAM,IAAA,WAAI,EAAC,oCAAoC,CAAC,CAAA;IACpE,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;IACzC,kEAAkE;IAClE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;IACpD,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,UAAkB;IAChD,OAAO,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,QAAQ,CAAA;AACzD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.importKy = importKy;
|
|
4
|
+
exports.importGetPort = importGetPort;
|
|
5
|
+
// Needed since we have to have dynamic import to esm module, since we are stuck with cjs on the nx tool runner
|
|
6
|
+
function importKy() {
|
|
7
|
+
return Function('return import("ky")')();
|
|
8
|
+
}
|
|
9
|
+
function importGetPort() {
|
|
10
|
+
return Function('return import("get-port")')();
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=import-esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-esm.js","sourceRoot":"","sources":["../../../../src/utils/common/import-esm.ts"],"names":[],"mappings":";;AACA,4BAEC;AAED,sCAIC;AATD,+GAA+G;AAC/G,SAAgB,QAAQ;IACtB,OAAO,QAAQ,CAAC,qBAAqB,CAAC,EAAkC,CAAA;AAC1E,CAAC;AAED,SAAgB,aAAa;IAC3B,OAAO,QAAQ,CAAC,2BAA2B,CAAC,EAE3C,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const consola: import("consola").ConsolaInstance;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../src/utils/common/logger.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAE1B,QAAA,OAAO,GAAG,IAAA,uBAAa,EAAC;IACnC,KAAK,EAAE,IAAI;CACZ,CAAC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
export declare function getDistForApp(context: ExecutorContext): Promise<string>;
|
|
3
|
+
/**
|
|
4
|
+
* Get the version of a project by reading from manifestRootsToUpdate
|
|
5
|
+
* @param context ExecutorContext containing merged configuration
|
|
6
|
+
* @returns {string | null} The project version from manifest files or null if not found
|
|
7
|
+
*/
|
|
8
|
+
export declare function getVersion(context: ExecutorContext): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Invoke Nx CLI to fetch affected projects with optional include/exclude filters.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getAffectedProjectCliWithFilters: (includes: string[], excludes: string[]) => Promise<import("tinyexec").Output>;
|
|
13
|
+
export declare const nxFns: {
|
|
14
|
+
getAffectedProjectCliWithFilters: (includes: string[], excludes: string[]) => Promise<import("tinyexec").Output>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Get the list of currently affected projects that have the nx-release-publish target (which make them publishable)
|
|
18
|
+
* and are included in the release configuration.
|
|
19
|
+
*
|
|
20
|
+
* @param releaseGroups
|
|
21
|
+
*/
|
|
22
|
+
export declare function getAffectedProjects(releaseGroups?: string[]): Promise<string[]>;
|