carlin 1.26.5 → 1.26.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.
- package/dist/cli.js +32 -7
- package/dist/config.js +0 -0
- package/dist/deploy/addDefaults.cloudFormation.js +0 -0
- package/dist/deploy/baseStack/command.js +0 -0
- package/dist/deploy/baseStack/config.js +0 -0
- package/dist/deploy/baseStack/deployBaseStack.js +4 -2
- package/dist/deploy/baseStack/getBaseStackResource.js +0 -0
- package/dist/deploy/baseStack/getBucket.template.js +0 -0
- package/dist/deploy/baseStack/getLambdaImageBuilder.template.js +4 -2
- package/dist/deploy/baseStack/getLambdaLayerBuilder.template.js +0 -0
- package/dist/deploy/baseStack/getVpc.template.js +0 -0
- package/dist/deploy/cicd/cicd.template.js +4 -2
- package/dist/deploy/cicd/command.js +4 -2
- package/dist/deploy/cicd/command.options.js +4 -2
- package/dist/deploy/cicd/config.js +0 -0
- package/dist/deploy/cicd/deployCicd.js +29 -4
- package/dist/deploy/cicd/ecsTaskReportCommand.js +5 -3
- package/dist/deploy/cicd/getCicdStackName.js +0 -0
- package/dist/deploy/cicd/getTriggerPipelineObjectKey.js +0 -0
- package/dist/deploy/cicd/lambdas/cicdApiV1.handler.js +0 -0
- package/dist/deploy/cicd/lambdas/ecsTaskReport.handler.js +0 -0
- package/dist/deploy/cicd/lambdas/executeTasks.js +0 -0
- package/dist/deploy/cicd/lambdas/getProcessEnvVariable.js +0 -0
- package/dist/deploy/cicd/lambdas/githubWebhooksApiV1.handler.js +4 -2
- package/dist/deploy/cicd/lambdas/imageUpdaterSchedule.handler.js +0 -0
- package/dist/deploy/cicd/lambdas/index.js +0 -0
- package/dist/deploy/cicd/lambdas/pipelines.handler.js +28 -3
- package/dist/deploy/cicd/lambdas/putApprovalResultManualTask.js +0 -0
- package/dist/deploy/cicd/pipelines.js +0 -0
- package/dist/deploy/cicd/readSSHKey.js +24 -2
- package/dist/deploy/cloudFormation.core.js +30 -5
- package/dist/deploy/cloudFormation.js +4 -2
- package/dist/deploy/command.js +4 -2
- package/dist/deploy/lambda/buildLambdaSingleFile.js +30 -5
- package/dist/deploy/lambda/deployLambdaCode.js +5 -3
- package/dist/deploy/lambda/deployLambdaLayers.js +5 -3
- package/dist/deploy/lambda/uploadCodeToECR.js +0 -0
- package/dist/deploy/lambda/uploadCodeToS3.js +7 -5
- package/dist/deploy/lambdaLayer/command.js +4 -2
- package/dist/deploy/lambdaLayer/deployLambdaLayer.js +4 -2
- package/dist/deploy/readDockerfile.js +25 -3
- package/dist/deploy/s3.js +7 -5
- package/dist/deploy/stackName.js +0 -0
- package/dist/deploy/staticApp/command.js +4 -2
- package/dist/deploy/staticApp/deployStaticApp.js +0 -0
- package/dist/deploy/staticApp/findDefaultBuildFolder.js +0 -0
- package/dist/deploy/staticApp/getOriginShieldRegion.js +0 -0
- package/dist/deploy/staticApp/getStaticAppBucket.js +0 -0
- package/dist/deploy/staticApp/invalidateCloudFront.js +4 -2
- package/dist/deploy/staticApp/removeOldVersions.js +5 -3
- package/dist/deploy/staticApp/staticApp.template.js +0 -0
- package/dist/deploy/staticApp/uploadBuiltAppToS3.js +0 -0
- package/dist/deploy/utils.js +4 -2
- package/dist/generateEnv/generateEnv.js +29 -4
- package/dist/generateEnv/generateEnvCommand.js +0 -0
- package/dist/index.js +4 -2
- package/dist/utils/addGroupToOptions.js +0 -0
- package/dist/utils/cloudFormationTemplate.js +4 -2
- package/dist/utils/codeBuild.js +4 -2
- package/dist/utils/environmentVariables.js +0 -0
- package/dist/utils/exec.js +5 -3
- package/dist/utils/formatCode.js +25 -3
- package/dist/utils/getAwsAccountId.js +0 -0
- package/dist/utils/getCurrentBranch.js +4 -2
- package/dist/utils/getEnvironment.js +0 -0
- package/dist/utils/getIamPath.js +0 -0
- package/dist/utils/getProjectName.js +0 -0
- package/dist/utils/index.js +26 -13
- package/dist/utils/packageJson.js +5 -3
- package/dist/utils/readCloudFormationTemplate.js +35 -0
- package/dist/utils/readObjectFile.js +49 -0
- package/package.json +15 -15
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
29
|
exports.options = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
30
|
/* eslint-disable no-param-reassign */
|
|
6
|
-
const yargs =
|
|
31
|
+
const yargs = __importStar(require("yargs"));
|
|
7
32
|
const config_1 = require("./config");
|
|
8
33
|
const utils_1 = require("./utils");
|
|
9
34
|
const change_case_1 = require("change-case");
|
|
@@ -11,11 +36,11 @@ const command_1 = require("./deploy/command");
|
|
|
11
36
|
const ecsTaskReportCommand_1 = require("./deploy/cicd/ecsTaskReportCommand");
|
|
12
37
|
const generateEnvCommand_1 = require("./generateEnv/generateEnvCommand");
|
|
13
38
|
const cloudformation_1 = require("@ttoss/cloudformation");
|
|
14
|
-
const aws_sdk_1 =
|
|
15
|
-
const deep_equal_1 =
|
|
16
|
-
const deepmerge_1 =
|
|
17
|
-
const findup_sync_1 =
|
|
18
|
-
const path_1 =
|
|
39
|
+
const aws_sdk_1 = __importDefault(require("aws-sdk"));
|
|
40
|
+
const deep_equal_1 = __importDefault(require("deep-equal"));
|
|
41
|
+
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
42
|
+
const findup_sync_1 = __importDefault(require("findup-sync"));
|
|
43
|
+
const path_1 = __importDefault(require("path"));
|
|
19
44
|
const coerceSetEnvVar = (env) => {
|
|
20
45
|
return (value) => {
|
|
21
46
|
if (value) {
|
package/dist/config.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.deployBaseStack = exports.baseStackTemplate = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const config_1 = require("./config");
|
|
6
8
|
const cloudFormation_core_1 = require("../cloudFormation.core");
|
|
7
9
|
const getBucket_template_1 = require("./getBucket.template");
|
|
@@ -9,7 +11,7 @@ const getLambdaImageBuilder_template_1 = require("./getLambdaImageBuilder.templa
|
|
|
9
11
|
const getLambdaLayerBuilder_template_1 = require("./getLambdaLayerBuilder.template");
|
|
10
12
|
const getVpc_template_1 = require("./getVpc.template");
|
|
11
13
|
const utils_1 = require("../utils");
|
|
12
|
-
const deepmerge_1 =
|
|
14
|
+
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
13
15
|
const logPrefix = 'base-stack';
|
|
14
16
|
exports.baseStackTemplate = deepmerge_1.default.all([
|
|
15
17
|
(0, getBucket_template_1.getBucketTemplate)(),
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getLambdaImageBuilderTemplate = void 0;
|
|
4
|
-
const
|
|
5
|
-
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
7
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
6
8
|
const utils_1 = require("../../utils");
|
|
7
9
|
const config_1 = require("./config");
|
|
8
10
|
const getLambdaImageBuilderTemplate = () => {
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getCicdTemplate = exports.getRepositoryImageBuilder = exports.IMAGE_UPDATER_SCHEDULE_SERVERLESS_FUNCTION_LOGICAL_ID = exports.PIPELINES_HANDLER_LAMBDA_FUNCTION_LOGICAL_ID = exports.PIPELINES_TAG_LOGICAL_ID = exports.PIPELINES_MAIN_LOGICAL_ID = exports.PIPELINES_ROLE_LOGICAL_ID = exports.PIPELINES_ARTIFACT_STORE_S3_BUCKET_LOGICAL_ID = exports.REPOSITORY_TASKS_ECS_TASK_DEFINITION_TASK_ROLE_LOGICAL_ID = exports.REPOSITORY_TASKS_ECS_TASK_DEFINITION_EXECUTION_ROLE_LOGICAL_ID = exports.REPOSITORY_TASKS_ECS_CLUSTER_LOGS_LOG_GROUP_LOGICAL_ID = exports.REPOSITORY_TASKS_ECS_CLUSTER_LOGICAL_ID = exports.REPOSITORY_IMAGE_CODE_BUILD_PROJECT_LOGICAL_ID = exports.REPOSITORY_ECS_TASK_DEFINITION_LOGICAL_ID = exports.REPOSITORY_ECS_TASK_CONTAINER_NAME = exports.PROCESS_ENV_REPOSITORY_IMAGE_CODE_BUILD_PROJECT_NAME = exports.ECS_TASK_REPORT_HANDLER_LAMBDA_FUNCTION_LOGICAL_ID = exports.FUNCTION_IAM_ROLE_LOGICAL_ID = exports.ECR_REPOSITORY_LOGICAL_ID = exports.CODE_BUILD_PROJECT_SERVICE_ROLE_LOGICAL_ID = exports.CODE_BUILD_PROJECT_LOGS_LOGICAL_ID = exports.API_LOGICAL_ID = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const config_1 = require("../baseStack/config");
|
|
6
8
|
const command_options_1 = require("./command.options");
|
|
7
9
|
const utils_1 = require("../../utils");
|
|
@@ -9,7 +11,7 @@ const config_2 = require("./config");
|
|
|
9
11
|
const config_3 = require("../../config");
|
|
10
12
|
const getTriggerPipelineObjectKey_1 = require("./getTriggerPipelineObjectKey");
|
|
11
13
|
const change_case_1 = require("change-case");
|
|
12
|
-
const js_yaml_1 =
|
|
14
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
13
15
|
exports.API_LOGICAL_ID = 'ApiV1ServerlessApi';
|
|
14
16
|
exports.CODE_BUILD_PROJECT_LOGS_LOGICAL_ID = 'RepositoryImageCodeBuildProjectLogsLogGroup';
|
|
15
17
|
exports.CODE_BUILD_PROJECT_SERVICE_ROLE_LOGICAL_ID = 'RepositoryImageCodeBuildProjectIAMRole';
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.deployCicdCommand = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const config_1 = require("../../config");
|
|
6
8
|
const utils_1 = require("../../utils");
|
|
7
9
|
const deployCicd_1 = require("./deployCicd");
|
|
8
10
|
const command_options_1 = require("./command.options");
|
|
9
11
|
const readSSHKey_1 = require("./readSSHKey");
|
|
10
|
-
const npmlog_1 =
|
|
12
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
11
13
|
const logPrefix = 'deploy-cicd';
|
|
12
14
|
exports.deployCicdCommand = {
|
|
13
15
|
command: 'cicd',
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getCicdConfig = exports.options = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const change_case_1 = require("change-case");
|
|
6
8
|
const pipelines_1 = require("./pipelines");
|
|
7
|
-
const yargs_1 =
|
|
9
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
8
10
|
exports.options = {
|
|
9
11
|
cpu: {
|
|
10
12
|
type: 'string',
|
|
File without changes
|
|
@@ -1,16 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
29
|
exports.deployCicd = exports.getLambdaInput = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const path = tslib_1.__importStar(require("path"));
|
|
30
|
+
const fs = __importStar(require("fs"));
|
|
31
|
+
const path = __importStar(require("path"));
|
|
7
32
|
const cicd_template_1 = require("./cicd.template");
|
|
8
33
|
const cloudFormation_core_1 = require("../cloudFormation.core");
|
|
9
34
|
const deployLambdaCode_1 = require("../lambda/deployLambdaCode");
|
|
10
35
|
const getCicdStackName_1 = require("./getCicdStackName");
|
|
11
36
|
const utils_1 = require("../utils");
|
|
12
37
|
const utils_2 = require("../../utils");
|
|
13
|
-
const npmlog_1 =
|
|
38
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
14
39
|
const logPrefix = 'cicd';
|
|
15
40
|
const getLambdaInput = (extension) => {
|
|
16
41
|
return path.resolve(__dirname, `lambdas/index.${extension}`);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ecsTaskReportCommand = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const npmlog_1 = tslib_1.__importDefault(require("npmlog"));
|
|
7
|
+
const aws_sdk_1 = __importDefault(require("aws-sdk"));
|
|
8
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
7
9
|
const logPrefix = 'cicd-ecs-task-report';
|
|
8
10
|
/**
|
|
9
11
|
* This method create the payload to send to Lambda ECS task report handler.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.githubWebhooksApiV1Handler = exports.webhooks = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const pipelines_1 = require("../pipelines");
|
|
6
8
|
const aws_sdk_1 = require("aws-sdk");
|
|
7
9
|
const webhooks_1 = require("@octokit/webhooks");
|
|
@@ -9,7 +11,7 @@ const executeTasks_1 = require("./executeTasks");
|
|
|
9
11
|
const getProcessEnvVariable_1 = require("./getProcessEnvVariable");
|
|
10
12
|
const getTriggerPipelineObjectKey_1 = require("../getTriggerPipelineObjectKey");
|
|
11
13
|
const shConditionalCommands_1 = require("./shConditionalCommands");
|
|
12
|
-
const adm_zip_1 =
|
|
14
|
+
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
13
15
|
const s3 = new aws_sdk_1.S3();
|
|
14
16
|
/**
|
|
15
17
|
* When this file is saved on S3, a CodePipeline pipeline is started.
|
|
File without changes
|
|
File without changes
|
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
29
|
exports.pipelinesHandler = exports.getJobDetails = exports.getJobDetailsFilename = void 0;
|
|
4
|
-
const
|
|
5
|
-
const fs = tslib_1.__importStar(require("fs"));
|
|
30
|
+
const fs = __importStar(require("fs"));
|
|
6
31
|
const aws_sdk_1 = require("aws-sdk");
|
|
7
32
|
const pipelines_1 = require("../pipelines");
|
|
8
33
|
const executeTasks_1 = require("./executeTasks");
|
|
9
34
|
const putApprovalResultManualTask_1 = require("./putApprovalResultManualTask");
|
|
10
35
|
const shConditionalCommands_1 = require("./shConditionalCommands");
|
|
11
|
-
const adm_zip_1 =
|
|
36
|
+
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
12
37
|
const codepipeline = new aws_sdk_1.CodePipeline();
|
|
13
38
|
const getUserParameters = (event) => {
|
|
14
39
|
const [pipeline, stage] = event['CodePipeline.job'].data.actionConfiguration.configuration.UserParameters.split('&');
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.readSSHKey = void 0;
|
|
4
|
-
const
|
|
5
|
-
const fs = tslib_1.__importStar(require("fs"));
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
6
28
|
/**
|
|
7
29
|
* Created to allow mocking.
|
|
8
30
|
*/
|
|
@@ -1,15 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
29
|
exports.destroy = exports.canDestroyStack = exports.deploy = exports.defaultTemplatePaths = exports.enableTerminationProtection = exports.updateStack = exports.createStack = exports.deleteStack = exports.printStackOutputsAfterDeploy = exports.getStackOutput = exports.describeStack = exports.describeStackEvents = exports.doesStackExist = exports.describeStackResource = exports.describeStacks = exports.cloudFormationV2 = exports.cloudFormation = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const path = tslib_1.__importStar(require("path"));
|
|
30
|
+
const fs = __importStar(require("fs"));
|
|
31
|
+
const path = __importStar(require("path"));
|
|
7
32
|
const client_cloudformation_1 = require("@aws-sdk/client-cloudformation");
|
|
8
33
|
const utils_1 = require("../utils");
|
|
9
34
|
const addDefaults_cloudFormation_1 = require("./addDefaults.cloudFormation");
|
|
10
35
|
const s3_1 = require("./s3");
|
|
11
|
-
const aws_sdk_1 =
|
|
12
|
-
const npmlog_1 =
|
|
36
|
+
const aws_sdk_1 = __importDefault(require("aws-sdk"));
|
|
37
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
13
38
|
const logPrefix = 'cloudformation';
|
|
14
39
|
npmlog_1.default.addLevel('event', 10000, { fg: 'yellow' });
|
|
15
40
|
npmlog_1.default.addLevel('output', 10000, { fg: 'blue' });
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.destroyCloudFormation = exports.deployCloudFormation = exports.defaultTemplatePaths = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const utils_1 = require("../utils");
|
|
6
8
|
const cloudFormation_core_1 = require("./cloudFormation.core");
|
|
7
9
|
const deployLambdaCode_1 = require("./lambda/deployLambdaCode");
|
|
@@ -9,7 +11,7 @@ const s3_1 = require("./s3");
|
|
|
9
11
|
const cloudformation_1 = require("@ttoss/cloudformation");
|
|
10
12
|
const stackName_1 = require("./stackName");
|
|
11
13
|
const utils_2 = require("./utils");
|
|
12
|
-
const npmlog_1 =
|
|
14
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
13
15
|
const logPrefix = 'cloudformation';
|
|
14
16
|
npmlog_1.default.addLevel('event', 10000, { fg: 'yellow' });
|
|
15
17
|
npmlog_1.default.addLevel('output', 10000, { fg: 'blue' });
|
package/dist/deploy/command.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.deployCommand = exports.examples = exports.options = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const utils_1 = require("../utils");
|
|
6
8
|
const command_1 = require("./baseStack/command");
|
|
7
9
|
const command_2 = require("./cicd/command");
|
|
@@ -11,7 +13,7 @@ const command_4 = require("./staticApp/command");
|
|
|
11
13
|
const stackName_1 = require("./stackName");
|
|
12
14
|
const cloudFormation_core_1 = require("./cloudFormation.core");
|
|
13
15
|
const readDockerfile_1 = require("./readDockerfile");
|
|
14
|
-
const npmlog_1 =
|
|
16
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
15
17
|
const logPrefix = 'deploy';
|
|
16
18
|
const checkAwsAccountId = async (awsAccountId) => {
|
|
17
19
|
try {
|
|
@@ -1,11 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
29
|
exports.buildLambdaSingleFile = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
30
|
+
const esbuild = __importStar(require("esbuild"));
|
|
31
|
+
const builtin_modules_1 = __importDefault(require("builtin-modules"));
|
|
32
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
33
|
+
const path_1 = __importDefault(require("path"));
|
|
9
34
|
const logPrefix = 'lambda';
|
|
10
35
|
const outFolder = 'dist';
|
|
11
36
|
const outFile = 'index.js';
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.deployLambdaCode = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const buildLambdaSingleFile_1 = require("./buildLambdaSingleFile");
|
|
6
8
|
const deployLambdaLayers_1 = require("./deployLambdaLayers");
|
|
7
9
|
const uploadCodeToECR_1 = require("./uploadCodeToECR");
|
|
8
10
|
const uploadCodeToS3_1 = require("./uploadCodeToS3");
|
|
9
|
-
const fs_1 =
|
|
10
|
-
const npmlog_1 =
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
11
13
|
const logPrefix = 'lambda';
|
|
12
14
|
/**
|
|
13
15
|
* 1. Build Lambda code using esbuild. The build process will create a single
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.deployLambdaLayers = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const deployLambdaLayer_1 = require("../lambdaLayer/deployLambdaLayer");
|
|
6
|
-
const npmlog_1 =
|
|
7
|
-
const path_1 =
|
|
8
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
8
10
|
const logPrefix = 'lambda';
|
|
9
11
|
const deployLambdaLayers = async ({ lambdaExternals = [], }) => {
|
|
10
12
|
if (lambdaExternals.length === 0) {
|
|
File without changes
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.uploadCodeToS3 = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const getBaseStackResource_1 = require("../baseStack/getBaseStackResource");
|
|
6
8
|
const s3_1 = require("../s3");
|
|
7
|
-
const adm_zip_1 =
|
|
8
|
-
const fs_1 =
|
|
9
|
-
const npmlog_1 =
|
|
10
|
-
const path_1 =
|
|
9
|
+
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
10
|
+
const fs_1 = __importDefault(require("fs"));
|
|
11
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
11
13
|
const logPrefix = 'lambda';
|
|
12
14
|
const outFolder = 'dist';
|
|
13
15
|
const outFile = 'index.js';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.deployLambdaLayerCommand = exports.options = void 0;
|
|
4
|
-
const
|
|
5
|
-
const npmlog_1 = tslib_1.__importDefault(require("npmlog"));
|
|
7
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
6
8
|
const config_1 = require("../../config");
|
|
7
9
|
const utils_1 = require("../../utils");
|
|
8
10
|
const deployLambdaLayer_1 = require("./deployLambdaLayer");
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.deployLambdaLayer = exports.getLambdaLayerTemplate = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const utils_1 = require("../../utils");
|
|
6
8
|
const aws_sdk_1 = require("aws-sdk");
|
|
7
9
|
const config_1 = require("../../config");
|
|
@@ -9,7 +11,7 @@ const cloudFormation_core_1 = require("../cloudFormation.core");
|
|
|
9
11
|
const getBaseStackResource_1 = require("../baseStack/getBaseStackResource");
|
|
10
12
|
const getPackageLambdaLayerStackName_1 = require("./getPackageLambdaLayerStackName");
|
|
11
13
|
const utils_2 = require("../utils");
|
|
12
|
-
const npmlog_1 =
|
|
14
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
13
15
|
const logPrefix = 'lambda-layer';
|
|
14
16
|
const createLambdaLayerZipFile = async ({ codeBuildProjectName, packageName, }) => {
|
|
15
17
|
var _a, _b;
|
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.readDockerfile = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const path = tslib_1.__importStar(require("path"));
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
7
29
|
/**
|
|
8
30
|
* This method was created because fs.readFileSync cannot be mocked.
|
|
9
31
|
*/
|
package/dist/deploy/s3.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.deleteS3Directory = exports.emptyS3Directory = exports.uploadDirectoryToS3 = exports.getAllFilesInsideADirectory = exports.uploadFileToS3 = exports.getBucketKeyUrl = exports.s3 = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
/* eslint-disable no-restricted-syntax */
|
|
6
8
|
/* eslint-disable no-await-in-loop */
|
|
7
9
|
const aws_sdk_1 = require("aws-sdk");
|
|
8
10
|
const glob_1 = require("glob");
|
|
9
|
-
const fs_1 =
|
|
10
|
-
const npmlog_1 =
|
|
11
|
-
const mime_types_1 =
|
|
12
|
-
const path_1 =
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
13
|
+
const mime_types_1 = __importDefault(require("mime-types"));
|
|
14
|
+
const path_1 = __importDefault(require("path"));
|
|
13
15
|
const logPrefix = 's3';
|
|
14
16
|
exports.s3 = new aws_sdk_1.S3({ apiVersion: '2006-03-01' });
|
|
15
17
|
const getBucketKeyUrl = ({ bucket, key, }) => {
|
package/dist/deploy/stackName.js
CHANGED
|
File without changes
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.deployStaticAppCommand = exports.options = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
/* eslint-disable no-param-reassign */
|
|
6
8
|
const config_1 = require("../../config");
|
|
7
9
|
const utils_1 = require("../../utils");
|
|
8
10
|
const findDefaultBuildFolder_1 = require("./findDefaultBuildFolder");
|
|
9
11
|
const deployStaticApp_1 = require("./deployStaticApp");
|
|
10
12
|
const cloudFormation_1 = require("../cloudFormation");
|
|
11
|
-
const aws_sdk_1 =
|
|
13
|
+
const aws_sdk_1 = __importDefault(require("aws-sdk"));
|
|
12
14
|
exports.options = {
|
|
13
15
|
acm: {
|
|
14
16
|
describe: 'The ARN of the certificate or the name of the exported variable whose value is the ARN of the certificate that will be associated to CloudFront.',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.invalidateCloudFront = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const aws_sdk_1 = require("aws-sdk");
|
|
6
|
-
const npmlog_1 =
|
|
8
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
7
9
|
const CLOUDFRONT_DISTRIBUTION_ID = 'CloudFrontDistributionId';
|
|
8
10
|
const logPrefix = 'static-app';
|
|
9
11
|
const invalidateCloudFront = async ({ outputs, }) => {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.removeOldVersions = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const s3_1 = require("../s3");
|
|
6
|
-
const npmlog_1 =
|
|
7
|
-
const semver_1 =
|
|
8
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
9
|
+
const semver_1 = __importDefault(require("semver"));
|
|
8
10
|
const logPrefix = 'static-app';
|
|
9
11
|
/**
|
|
10
12
|
* When a static-app deployment is executed, the algorithm delete old versions
|
|
File without changes
|
|
File without changes
|
package/dist/deploy/utils.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.handleDeployInitialization = exports.handleDeployError = exports.deployErrorLogs = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const stackName_1 = require("./stackName");
|
|
6
|
-
const npmlog_1 =
|
|
8
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
7
9
|
const deployErrorLogs = ({ error, logPrefix, }) => {
|
|
8
10
|
npmlog_1.default.error(logPrefix, `An error occurred. Cannot deploy ${logPrefix}.`);
|
|
9
11
|
npmlog_1.default.error(logPrefix, 'Error message: %j', error === null || error === void 0 ? void 0 : error.message);
|
|
@@ -1,11 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
29
|
exports.generateEnv = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const path = tslib_1.__importStar(require("path"));
|
|
30
|
+
const fs = __importStar(require("fs"));
|
|
31
|
+
const path = __importStar(require("path"));
|
|
7
32
|
const utils_1 = require("../utils");
|
|
8
|
-
const npmlog_1 =
|
|
33
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
9
34
|
const logPrefix = 'generate-env';
|
|
10
35
|
const getEnvFilePath = ({ envFileName }) => {
|
|
11
36
|
return path.resolve(process.cwd(), envFileName);
|
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const cli_1 = tslib_1.__importDefault(require("./cli"));
|
|
6
|
+
const cli_1 = __importDefault(require("./cli"));
|
|
5
7
|
(0, cli_1.default)().parse();
|
|
File without changes
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.loadCloudFormationTemplate = exports.dumpToYamlCloudFormationTemplate = exports.getSchema = void 0;
|
|
4
|
-
const
|
|
5
|
-
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
7
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
6
8
|
const cloudFormationTypes = [
|
|
7
9
|
{
|
|
8
10
|
tag: '!Equals',
|
package/dist/utils/codeBuild.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.startCodeBuildBuild = exports.waitCodeBuildFinish = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const aws_sdk_1 = require("aws-sdk");
|
|
6
|
-
const npmlog_1 =
|
|
8
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
7
9
|
const logPrefix = 'codebuild';
|
|
8
10
|
const WAIT_TIME = 10 * 1000;
|
|
9
11
|
/**
|
|
File without changes
|
package/dist/utils/exec.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.exec = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const npmlog_1 = tslib_1.__importDefault(require("npmlog"));
|
|
7
|
+
const child_process_1 = __importDefault(require("child_process"));
|
|
8
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
7
9
|
npmlog_1.default.heading = 'exec';
|
|
8
10
|
const exec = (cmd) => new Promise((resolve, reject) => {
|
|
9
11
|
child_process_1.default.exec(cmd, (error, stdout, stderr) => {
|
package/dist/utils/formatCode.js
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.uglify = exports.formatCode = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const prettier = tslib_1.__importStar(require("prettier"));
|
|
27
|
+
const UglifyJS = __importStar(require("uglify-js"));
|
|
28
|
+
const prettier = __importStar(require("prettier"));
|
|
7
29
|
const formatCode = (code) => {
|
|
8
30
|
return prettier.format(code, { parser: 'babel' });
|
|
9
31
|
};
|
|
File without changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getCurrentBranch = exports.BRANCH_UNDEFINED = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
7
|
const environmentVariables_1 = require("./environmentVariables");
|
|
6
|
-
const simple_git_1 =
|
|
8
|
+
const simple_git_1 = __importDefault(require("simple-git"));
|
|
7
9
|
exports.BRANCH_UNDEFINED = '';
|
|
8
10
|
/**
|
|
9
11
|
* Git current branch is used to determine the name of the stack when deploying
|
|
File without changes
|
package/dist/utils/getIamPath.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/utils/index.js
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
tslib_1.__exportStar(require("./packageJson"), exports);
|
|
17
|
+
__exportStar(require("./addGroupToOptions"), exports);
|
|
18
|
+
__exportStar(require("./codeBuild"), exports);
|
|
19
|
+
__exportStar(require("./cloudFormationTemplate"), exports);
|
|
20
|
+
__exportStar(require("./environmentVariables"), exports);
|
|
21
|
+
__exportStar(require("./exec"), exports);
|
|
22
|
+
__exportStar(require("./formatCode"), exports);
|
|
23
|
+
__exportStar(require("./getAwsAccountId"), exports);
|
|
24
|
+
__exportStar(require("./getCurrentBranch"), exports);
|
|
25
|
+
__exportStar(require("./getEnvironment"), exports);
|
|
26
|
+
__exportStar(require("./getIamPath"), exports);
|
|
27
|
+
__exportStar(require("./getProjectName"), exports);
|
|
28
|
+
__exportStar(require("./packageJson"), exports);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getPackageVersion = exports.getPackageName = exports.readPackageJson = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
|
+
const findup_sync_1 = __importDefault(require("findup-sync"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
9
|
const readPackageJson = () => {
|
|
8
10
|
const packageJsonDir = (0, findup_sync_1.default)('package.json');
|
|
9
11
|
if (!packageJsonDir) {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readCloudFormationYamlTemplate = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const cloudFormationTemplate_1 = require("./cloudFormationTemplate");
|
|
8
|
+
const getTypes = () => {
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
tag: `!SubString`,
|
|
12
|
+
options: {
|
|
13
|
+
kind: 'scalar',
|
|
14
|
+
construct: (filePath) => {
|
|
15
|
+
return fs
|
|
16
|
+
.readFileSync(path.resolve(process.cwd(), filePath))
|
|
17
|
+
.toString();
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* CloudFormation
|
|
25
|
+
* @param param0
|
|
26
|
+
*/
|
|
27
|
+
const readCloudFormationYamlTemplate = ({ templatePath, }) => {
|
|
28
|
+
const template = fs.readFileSync(templatePath).toString();
|
|
29
|
+
const parsed = (0, cloudFormationTemplate_1.loadCloudFormationTemplate)(template, getTypes());
|
|
30
|
+
if (!parsed || typeof parsed === 'string') {
|
|
31
|
+
throw new Error('Cannot parse CloudFormation template.');
|
|
32
|
+
}
|
|
33
|
+
return parsed;
|
|
34
|
+
};
|
|
35
|
+
exports.readCloudFormationYamlTemplate = readCloudFormationYamlTemplate;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readObjectFile = exports.readYaml = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
6
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
8
|
+
const readYaml = ({ path }) => {
|
|
9
|
+
const template = fs_1.default.readFileSync(path, 'utf8') || JSON.stringify({});
|
|
10
|
+
return js_yaml_1.default.load(template);
|
|
11
|
+
};
|
|
12
|
+
exports.readYaml = readYaml;
|
|
13
|
+
/**
|
|
14
|
+
* If your file is `.ts`, you must you must export the final object
|
|
15
|
+
* `export default { ... }`. If your file is `.js`, you must you must export
|
|
16
|
+
* the final object `module.exports = { ... }`. `.json` and `.yml/yaml` must
|
|
17
|
+
* define the resources in [JSON](https://www.json.org/json-en.html) and
|
|
18
|
+
* [YAML](https://yaml.org/) format respectively.
|
|
19
|
+
*/
|
|
20
|
+
const readObjectFile = ({ path }) => {
|
|
21
|
+
if (!fs_1.default.existsSync(path)) {
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
const extension = path.split('.').pop();
|
|
25
|
+
if (extension === 'ts') {
|
|
26
|
+
require('ts-node').register({
|
|
27
|
+
compilerOptions: { module: 'commonjs' },
|
|
28
|
+
moduleTypes: {
|
|
29
|
+
'carlin.*': 'cjs',
|
|
30
|
+
},
|
|
31
|
+
transpileOnly: true,
|
|
32
|
+
});
|
|
33
|
+
const tsObj = require(path);
|
|
34
|
+
const obj = tsObj.default || tsObj;
|
|
35
|
+
return typeof obj === 'function' ? obj() : obj;
|
|
36
|
+
}
|
|
37
|
+
if (extension === 'js') {
|
|
38
|
+
const obj = require(path);
|
|
39
|
+
return typeof obj === 'function' ? obj() : obj;
|
|
40
|
+
}
|
|
41
|
+
if (extension === 'json') {
|
|
42
|
+
return require(path);
|
|
43
|
+
}
|
|
44
|
+
if (extension === 'yml' || extension === 'yaml') {
|
|
45
|
+
return (0, exports.readYaml)({ path });
|
|
46
|
+
}
|
|
47
|
+
return {};
|
|
48
|
+
};
|
|
49
|
+
exports.readObjectFile = readObjectFile;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carlin",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"author": "Pedro Arantes <arantespp@gmail.com> (https://twitter.com/arantespp)",
|
|
@@ -26,50 +26,50 @@
|
|
|
26
26
|
"test": "jest"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aws-sdk/client-cloudformation": "^3.
|
|
30
|
-
"@octokit/webhooks": "^
|
|
29
|
+
"@aws-sdk/client-cloudformation": "^3.312.0",
|
|
30
|
+
"@octokit/webhooks": "^11.0.0",
|
|
31
31
|
"@slack/webhook": "^6.1.0",
|
|
32
|
-
"@ttoss/cloudformation": "^0.6.
|
|
32
|
+
"@ttoss/cloudformation": "^0.6.9",
|
|
33
33
|
"adm-zip": "^0.5.10",
|
|
34
|
-
"aws-sdk": "^2.
|
|
34
|
+
"aws-sdk": "^2.1359.0",
|
|
35
35
|
"builtin-modules": "^3.3.0",
|
|
36
36
|
"change-case": "^4.1.2",
|
|
37
37
|
"deep-equal": "^2.2.0",
|
|
38
38
|
"deepmerge": "^4.3.1",
|
|
39
39
|
"dotenv": "^16.0.3",
|
|
40
|
-
"esbuild": "^0.17.
|
|
40
|
+
"esbuild": "^0.17.16",
|
|
41
41
|
"findup-sync": "^5.0.0",
|
|
42
|
-
"glob": "^
|
|
42
|
+
"glob": "^10.1.0",
|
|
43
43
|
"js-yaml": "^4.1.0",
|
|
44
44
|
"mime-types": "^2.1.35",
|
|
45
45
|
"npmlog": "^7.0.1",
|
|
46
|
-
"prettier": "^2.8.
|
|
47
|
-
"semver": "^7.
|
|
48
|
-
"simple-git": "^3.
|
|
46
|
+
"prettier": "^2.8.7",
|
|
47
|
+
"semver": "^7.4.0",
|
|
48
|
+
"simple-git": "^3.17.0",
|
|
49
49
|
"ts-node": "^10.9.1",
|
|
50
50
|
"uglify-js": "^3.17.4",
|
|
51
51
|
"yargs": "^17.7.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@ttoss/test-utils": "^1.21.
|
|
54
|
+
"@ttoss/test-utils": "^1.21.3",
|
|
55
55
|
"@types/adm-zip": "^0.5.0",
|
|
56
|
-
"@types/aws-lambda": "^8.10.
|
|
56
|
+
"@types/aws-lambda": "^8.10.114",
|
|
57
57
|
"@types/deep-equal": "^1.0.1",
|
|
58
58
|
"@types/findup-sync": "^4.0.2",
|
|
59
59
|
"@types/glob": "^8.1.0",
|
|
60
60
|
"@types/jest": "^29.5.0",
|
|
61
61
|
"@types/js-yaml": "^4.0.5",
|
|
62
62
|
"@types/mime-types": "^2.1.1",
|
|
63
|
-
"@types/node": "^18.
|
|
63
|
+
"@types/node": "^18.15.11",
|
|
64
64
|
"@types/npmlog": "^4.1.4",
|
|
65
65
|
"@types/semver": "^7.3.13",
|
|
66
66
|
"@types/uglify-js": "^3.17.1",
|
|
67
|
-
"@types/yargs": "^17.0.
|
|
67
|
+
"@types/yargs": "^17.0.24",
|
|
68
68
|
"jest": "^29.5.0"
|
|
69
69
|
},
|
|
70
70
|
"keywords": [],
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "81c9da91988b338a6449d84b4dfc183ccf9ed941"
|
|
75
75
|
}
|