@onivoro/onix 20.3.1 → 20.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/executors.json +29 -19
- package/package.json +6 -1
- package/src/executors/build-cli/executor.d.ts +2 -3
- package/src/executors/build-cli/executor.js +11 -14
- package/src/executors/build-cli/executor.js.map +1 -1
- package/src/executors/build-cli/schema.d.ts +1 -3
- package/src/executors/build-cli/schema.json +2 -7
- package/src/executors/deploy-ecs/executor.js +82 -0
- package/src/executors/deploy-ecs/executor.js.map +1 -0
- package/src/executors/deploy-ecs/schema.d.ts +9 -0
- package/src/executors/deploy-ecs/schema.json +32 -0
- package/src/executors/deploy-lambda/executor.d.ts +3 -0
- package/src/executors/deploy-lambda/executor.js +18 -0
- package/src/executors/deploy-lambda/executor.js.map +1 -0
- package/src/executors/deploy-lambda/schema.d.ts +3 -0
- package/src/executors/deploy-lambda/schema.json +57 -0
- package/src/executors/docker-run/executor.d.ts +3 -0
- package/src/executors/docker-run/executor.js +14 -0
- package/src/executors/docker-run/executor.js.map +1 -0
- package/src/executors/{docker → docker-run}/schema.d.ts +1 -1
- package/src/executors/{docker → docker-run}/schema.json +4 -4
- package/src/executors/local/executor.d.ts +2 -3
- package/src/executors/local/executor.js +9 -20
- package/src/executors/local/executor.js.map +1 -1
- package/src/executors/local/schema.d.ts +2 -3
- package/src/executors/local/schema.json +5 -12
- package/src/executors/openapi-gen/executor.d.ts +3 -0
- package/src/executors/openapi-gen/executor.js +11 -0
- package/src/executors/openapi-gen/executor.js.map +1 -0
- package/src/executors/openapi-gen/schema.d.ts +5 -0
- package/src/executors/openapi-gen/schema.json +25 -0
- package/src/executors/playwright/executor.d.ts +2 -3
- package/src/executors/playwright/executor.js +11 -15
- package/src/executors/playwright/executor.js.map +1 -1
- package/src/executors/playwright/schema.d.ts +1 -0
- package/src/executors/playwright/schema.json +5 -1
- package/src/executors/typeorm/executor.d.ts +3 -0
- package/src/executors/typeorm/executor.js +15 -0
- package/src/executors/typeorm/executor.js.map +1 -0
- package/src/executors/typeorm/schema.d.ts +5 -0
- package/src/executors/{db → typeorm}/schema.json +3 -7
- package/src/executors/xray/executor.d.ts +3 -0
- package/src/executors/xray/executor.js +21 -0
- package/src/executors/xray/executor.js.map +1 -0
- package/src/executors/xray/schema.d.ts +1 -0
- package/src/executors/xray/schema.json +9 -0
- package/src/functions/deploy-lambda.function.d.ts +17 -0
- package/src/functions/deploy-lambda.function.js +74 -0
- package/src/functions/deploy-lambda.function.js.map +1 -0
- package/src/functions/executor-factory.function.d.ts +5 -0
- package/src/functions/executor-factory.function.js +20 -0
- package/src/functions/executor-factory.function.js.map +1 -0
- package/src/functions/extract-project-build-assets.function.d.ts +2 -0
- package/src/functions/extract-project-build-assets.function.js +19 -0
- package/src/functions/extract-project-build-assets.function.js.map +1 -0
- package/src/functions/extract-project-build-outputs.function.d.ts +2 -0
- package/src/functions/extract-project-build-outputs.function.js +21 -0
- package/src/functions/extract-project-build-outputs.function.js.map +1 -0
- package/src/functions/extract-project-configuration.function.d.ts +2 -0
- package/src/functions/extract-project-configuration.function.js +14 -0
- package/src/functions/extract-project-configuration.function.js.map +1 -0
- package/src/functions/extract-target-configuration.function.d.ts +2 -0
- package/src/functions/extract-target-configuration.function.js +8 -0
- package/src/functions/extract-target-configuration.function.js.map +1 -0
- package/src/functions/interpolate.function.d.ts +2 -0
- package/src/functions/interpolate.function.js +8 -0
- package/src/functions/interpolate.function.js.map +1 -0
- package/src/functions/load-env-file.function.d.ts +1 -0
- package/src/functions/load-env-file.function.js +17 -0
- package/src/functions/load-env-file.function.js.map +1 -0
- package/src/functions/pm.function.d.ts +15 -0
- package/src/functions/pm.function.js +21 -0
- package/src/functions/pm.function.js.map +1 -0
- package/src/functions/pmx.function.d.ts +3 -0
- package/src/functions/pmx.function.js +21 -0
- package/src/functions/pmx.function.js.map +1 -0
- package/src/functions/push-image-to-ecr-wrapped.function.js +2 -1
- package/src/functions/push-image-to-ecr-wrapped.function.js.map +1 -1
- package/src/functions/push-image-to-ecr.function.d.ts +2 -3
- package/src/functions/push-image-to-ecr.function.js +39 -18
- package/src/functions/push-image-to-ecr.function.js.map +1 -1
- package/src/functions/resolve-aws-credentials.function.d.ts +1 -0
- package/src/functions/resolve-aws-credentials.function.js +15 -0
- package/src/functions/resolve-aws-credentials.function.js.map +1 -0
- package/src/functions/restart-ecs-service.function.d.ts +6 -0
- package/src/functions/restart-ecs-service.function.js +34 -0
- package/src/functions/restart-ecs-service.function.js.map +1 -0
- package/src/index.d.ts +17 -8
- package/src/index.js +17 -10
- package/src/index.js.map +1 -1
- package/src/{functions → inference}/add-db-target.function.js.map +1 -1
- package/src/{functions → inference}/add-db-targets.function.js.map +1 -1
- package/src/{functions → inference}/add-docker-deploy-target.function.js.map +1 -1
- package/src/{functions → inference}/add-docker-deploy-targets.function.js.map +1 -1
- package/src/{functions → inference}/add-docker-target.function.js.map +1 -1
- package/src/{functions → inference}/add-docker-targets.function.js +1 -1
- package/src/{functions → inference}/add-docker-targets.function.js.map +1 -1
- package/src/{functions → inference}/add-gen-target.function.js.map +1 -1
- package/src/{functions → inference}/add-serve-target.function.js.map +1 -1
- package/src/{functions → inference}/add-serve-targets.function.js +1 -1
- package/src/{functions → inference}/add-serve-targets.function.js.map +1 -1
- package/src/{functions → inference}/build-onix-targets.function.js.map +1 -1
- package/src/{functions → inference}/normalize-options.function.js.map +1 -1
- package/src/{functions → inference}/read-targets-cache.function.js.map +1 -1
- package/src/{functions → inference}/write-targets-to-cache.function.js.map +1 -1
- package/src/plugins/plugin.js +4 -4
- package/src/utils/vite-config-factory.d.ts +9 -0
- package/src/utils/vite-config-factory.js +48 -0
- package/src/utils/vite-config-factory.js.map +1 -0
- package/src/webpack/patch-nx-source-map-paths.function.d.ts +9 -0
- package/src/webpack/patch-nx-source-map-paths.function.js +13 -0
- package/src/webpack/patch-nx-source-map-paths.function.js.map +1 -0
- package/src/webpack/patch-nx-source-maps.plugin.d.ts +2 -0
- package/src/webpack/patch-nx-source-maps.plugin.js +11 -0
- package/src/webpack/patch-nx-source-maps.plugin.js.map +1 -0
- package/src/executors/db/executor.js +0 -20
- package/src/executors/db/executor.js.map +0 -1
- package/src/executors/db/schema.d.ts +0 -6
- package/src/executors/deploy/executor.d.ts +0 -4
- package/src/executors/deploy/executor.js +0 -33
- package/src/executors/deploy/executor.js.map +0 -1
- package/src/executors/deploy/schema.d.ts +0 -5
- package/src/executors/deploy/schema.json +0 -28
- package/src/executors/docker/executor.d.ts +0 -4
- package/src/executors/docker/executor.js +0 -24
- package/src/executors/docker/executor.js.map +0 -1
- package/src/executors/gen/executor.d.ts +0 -4
- package/src/executors/gen/executor.js +0 -19
- package/src/executors/gen/executor.js.map +0 -1
- package/src/executors/gen/schema.d.ts +0 -3
- package/src/executors/gen/schema.json +0 -14
- package/src/functions/create-nodes-internal.function.d.ts +0 -0
- package/src/functions/create-nodes-internal.function.js +0 -1
- package/src/functions/create-nodes-internal.function.js.map +0 -1
- /package/src/executors/{db → deploy-ecs}/executor.d.ts +0 -0
- /package/src/{functions → inference}/add-db-target.function.d.ts +0 -0
- /package/src/{functions → inference}/add-db-target.function.js +0 -0
- /package/src/{functions → inference}/add-db-targets.function.d.ts +0 -0
- /package/src/{functions → inference}/add-db-targets.function.js +0 -0
- /package/src/{functions → inference}/add-docker-deploy-target.function.d.ts +0 -0
- /package/src/{functions → inference}/add-docker-deploy-target.function.js +0 -0
- /package/src/{functions → inference}/add-docker-deploy-targets.function.d.ts +0 -0
- /package/src/{functions → inference}/add-docker-deploy-targets.function.js +0 -0
- /package/src/{functions → inference}/add-docker-target.function.d.ts +0 -0
- /package/src/{functions → inference}/add-docker-target.function.js +0 -0
- /package/src/{functions → inference}/add-docker-targets.function.d.ts +0 -0
- /package/src/{functions → inference}/add-gen-target.function.d.ts +0 -0
- /package/src/{functions → inference}/add-gen-target.function.js +0 -0
- /package/src/{functions → inference}/add-serve-target.function.d.ts +0 -0
- /package/src/{functions → inference}/add-serve-target.function.js +0 -0
- /package/src/{functions → inference}/add-serve-targets.function.d.ts +0 -0
- /package/src/{functions → inference}/build-onix-targets.function.d.ts +0 -0
- /package/src/{functions → inference}/build-onix-targets.function.js +0 -0
- /package/src/{functions → inference}/normalize-options.function.d.ts +0 -0
- /package/src/{functions → inference}/normalize-options.function.js +0 -0
- /package/src/{functions → inference}/read-targets-cache.function.d.ts +0 -0
- /package/src/{functions → inference}/read-targets-cache.function.js +0 -0
- /package/src/{functions → inference}/write-targets-to-cache.function.d.ts +0 -0
- /package/src/{functions → inference}/write-targets-to-cache.function.js +0 -0
package/executors.json
CHANGED
|
@@ -1,37 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"executors": {
|
|
3
3
|
"build-cli": {
|
|
4
|
-
"implementation": "./src/executors/build-cli",
|
|
4
|
+
"implementation": "./src/executors/build-cli/executor",
|
|
5
5
|
"schema": "./src/executors/build-cli/schema.json",
|
|
6
6
|
"description": "build-cli"
|
|
7
7
|
},
|
|
8
|
-
"
|
|
9
|
-
"implementation": "./src/executors/
|
|
10
|
-
"schema": "./src/executors/
|
|
11
|
-
"description": "
|
|
8
|
+
"typeorm": {
|
|
9
|
+
"implementation": "./src/executors/typeorm/executor",
|
|
10
|
+
"schema": "./src/executors/typeorm/schema.json",
|
|
11
|
+
"description": "typeorm"
|
|
12
12
|
},
|
|
13
13
|
"docker-run": {
|
|
14
|
-
"implementation": "./src/executors/docker",
|
|
15
|
-
"schema": "./src/executors/docker/schema.json",
|
|
14
|
+
"implementation": "./src/executors/docker-run/executor",
|
|
15
|
+
"schema": "./src/executors/docker-run/schema.json",
|
|
16
16
|
"description": "docker-run"
|
|
17
17
|
},
|
|
18
|
-
"
|
|
19
|
-
"implementation": "./src/executors/deploy",
|
|
20
|
-
"schema": "./src/executors/deploy/schema.json",
|
|
21
|
-
"description": "
|
|
18
|
+
"deploy-lambda": {
|
|
19
|
+
"implementation": "./src/executors/deploy-lambda/executor",
|
|
20
|
+
"schema": "./src/executors/deploy-lambda/schema.json",
|
|
21
|
+
"description": "deploy-lambda"
|
|
22
22
|
},
|
|
23
|
-
"
|
|
24
|
-
"implementation": "./src/executors/
|
|
25
|
-
"schema": "./src/executors/
|
|
26
|
-
"description": "
|
|
23
|
+
"deploy-ecs": {
|
|
24
|
+
"implementation": "./src/executors/deploy-ecs/executor",
|
|
25
|
+
"schema": "./src/executors/deploy-ecs/schema.json",
|
|
26
|
+
"description": "deploy-ecs"
|
|
27
27
|
},
|
|
28
|
-
"
|
|
29
|
-
"implementation": "./src/executors/
|
|
28
|
+
"openapi-gen": {
|
|
29
|
+
"implementation": "./src/executors/openapi-gen/executor",
|
|
30
|
+
"schema": "./src/executors/openapi-gen/schema.json",
|
|
31
|
+
"description": "openapi-gen"
|
|
32
|
+
},
|
|
33
|
+
"local": {
|
|
34
|
+
"implementation": "./src/executors/local/executor",
|
|
30
35
|
"schema": "./src/executors/local/schema.json",
|
|
31
|
-
"description": "
|
|
36
|
+
"description": "local"
|
|
37
|
+
},
|
|
38
|
+
"xray": {
|
|
39
|
+
"implementation": "./src/executors/xray/executor",
|
|
40
|
+
"schema": "./src/executors/xray/schema.json",
|
|
41
|
+
"description": "xray"
|
|
32
42
|
},
|
|
33
43
|
"playwright": {
|
|
34
|
-
"implementation": "./src/executors/playwright",
|
|
44
|
+
"implementation": "./src/executors/playwright/executor",
|
|
35
45
|
"schema": "./src/executors/playwright/schema.json",
|
|
36
46
|
"description": "playwright"
|
|
37
47
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onivoro/onix",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.5.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
7
7
|
"executors": "./executors.json",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@aws-sdk/client-ecr": "^3.734.0",
|
|
10
|
+
"@aws-sdk/client-ecs": "^3.734.0",
|
|
11
|
+
"@aws-sdk/client-lambda": "^3.734.0",
|
|
12
|
+
"@aws-sdk/client-s3": "^3.735.0",
|
|
10
13
|
"@aws-sdk/credential-providers": "^3.734.0",
|
|
11
14
|
"@nx/devkit": "^20.3.2",
|
|
12
15
|
"@nx/js": "20.3.2",
|
|
16
|
+
"@playwright/test": "^1.50.0",
|
|
17
|
+
"adm-zip": "^0.5.16",
|
|
13
18
|
"esbuild": "^0.24.2",
|
|
14
19
|
"esbuild-node-externals": "^1.16.0"
|
|
15
20
|
},
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PromiseExecutor } from '@nx/devkit';
|
|
2
1
|
import { ExecutorSchema } from './schema';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
2
|
+
declare const _default: import("@nx/devkit").PromiseExecutor<ExecutorSchema>;
|
|
3
|
+
export default _default;
|
|
@@ -3,18 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
exports.default = runExecutor;
|
|
6
|
+
const executor_factory_function_1 = require("../../functions/executor-factory.function");
|
|
7
|
+
const extract_project_build_outputs_function_1 = require("../../functions/extract-project-build-outputs.function");
|
|
8
|
+
const pm_function_1 = require("../../functions/pm.function");
|
|
9
|
+
exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
10
|
+
const [outputPath] = (0, extract_project_build_outputs_function_1.extractProjectBuildOutputs)(context, context.projectName);
|
|
11
|
+
const tempPath = `${outputPath}/temp`;
|
|
12
|
+
const executableOutputPath = `${outputPath}/main.js`;
|
|
13
|
+
devkit_1.logger.info(`add a bin entry to root package.json pointing at this executable => ${executableOutputPath} and re-run this if the bin entry hasn't been added yet`);
|
|
14
|
+
const { dlx, run } = (0, pm_function_1.pm)(context);
|
|
15
|
+
(0, child_process_1.execSync)(`${dlx} nx build ${context.projectName} && echo '#! /usr/bin/env node' > ${tempPath} && cat ${executableOutputPath} >> ${tempPath} && mv ${tempPath} ${executableOutputPath} && chmod +x ${executableOutputPath} && ${run} link`, { stdio: 'inherit' });
|
|
16
|
+
}));
|
|
20
17
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/build-cli/executor.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/build-cli/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAEpC,iDAAyC;AACzC,yFAA4E;AAC5E,mHAAoG;AACpG,6DAAiD;AAEjD,kBAAe,IAAA,2CAAe,EAAC,CAAO,OAAuB,EAAE,OAAO,EAAE,EAAE;IACxE,MAAM,CAAC,UAAU,CAAC,GAAG,IAAA,mEAA0B,EAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9E,MAAM,QAAQ,GAAG,GAAG,UAAU,OAAO,CAAC;IACtC,MAAM,oBAAoB,GAAG,GAAG,UAAU,UAAU,CAAC;IAErD,eAAM,CAAC,IAAI,CAAC,uEAAuE,oBAAoB,yDAAyD,CAAC,CAAC;IAElK,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAA,gBAAE,EAAC,OAAO,CAAC,CAAC;IAEjC,IAAA,wBAAQ,EAAC,GAAG,GAAG,aAAa,OAAO,CAAC,WAAW,qCAAqC,QAAQ,WAAW,oBAAoB,OAAO,QAAQ,UAAU,QAAQ,IAAI,oBAAoB,gBAAgB,oBAAoB,OAAO,GAAG,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC;AAClQ,CAAC,CAAA,CAAC,CAAC"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/schema",
|
|
3
3
|
"version": 2,
|
|
4
|
-
"title": "
|
|
4
|
+
"title": "Build-cli executor",
|
|
5
5
|
"description": "",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"moniker": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"description": "Lowercase single-word identifier used to consistently distinguish related projects and libraries"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
7
|
+
"properties": {},
|
|
13
8
|
"required": []
|
|
14
9
|
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const push_image_to_ecr_wrapped_function_1 = require("../../functions/push-image-to-ecr-wrapped.function");
|
|
7
|
+
const extract_project_build_outputs_function_1 = require("../../functions/extract-project-build-outputs.function");
|
|
8
|
+
const extract_project_build_assets_function_1 = require("../../functions/extract-project-build-assets.function");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const extract_project_configuration_function_1 = require("../../functions/extract-project-configuration.function");
|
|
11
|
+
const restart_ecs_service_function_1 = require("../../functions/restart-ecs-service.function");
|
|
12
|
+
const pmx_function_1 = require("../../functions/pmx.function");
|
|
13
|
+
const stdio = 'inherit';
|
|
14
|
+
const uiAssetFolderName = 'ui';
|
|
15
|
+
const executor = (options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const { ecr, profile, dockerfile, ui, region, cluster, service } = options;
|
|
17
|
+
(0, pmx_function_1.pmxSpawn)(context, `nx build ${context.projectName}`);
|
|
18
|
+
try {
|
|
19
|
+
const [apiProjectAssetPath] = (0, extract_project_build_assets_function_1.extractProjectBuildAssets)(context, context.projectName);
|
|
20
|
+
const [apiProjectOutput] = (0, extract_project_build_outputs_function_1.extractProjectBuildOutputs)(context, context.projectName);
|
|
21
|
+
if (ui) {
|
|
22
|
+
if (apiProjectAssetPath) {
|
|
23
|
+
const [webProjectOutputs] = (0, extract_project_build_outputs_function_1.extractProjectBuildOutputs)(context, ui);
|
|
24
|
+
if (webProjectOutputs === null || webProjectOutputs === void 0 ? void 0 : webProjectOutputs.length) {
|
|
25
|
+
(0, pmx_function_1.pmxSpawn)(context, `nx build ${ui}`);
|
|
26
|
+
const projectConfiguration = (0, extract_project_configuration_function_1.extractProjectConfiguration)(context, context.projectName);
|
|
27
|
+
const [projectDist] = apiProjectOutput.split(projectConfiguration.root);
|
|
28
|
+
const [__, projectAssetsPath] = apiProjectAssetPath.split(projectConfiguration.sourceRoot);
|
|
29
|
+
const projectDistAssetPathForUi = (0, path_1.join)(projectDist, projectConfiguration.root, projectAssetsPath, uiAssetFolderName);
|
|
30
|
+
[webProjectOutputs].forEach(output => {
|
|
31
|
+
(0, child_process_1.execSync)(`cp -R ${output} ${projectDistAssetPathForUi}`);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
devkit_1.logger.warn(`unable to locate target "build" outputs within project configuration for specified webProjectName "${ui}"`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
devkit_1.logger.warn(`unable to locate target "build" asset path (expecting targets.build.options.assets -> ["things/and/stuff"]) within project configuration for project "${context.projectName}"`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const [projectOutput] = (0, extract_project_build_outputs_function_1.extractProjectBuildOutputs)(context, context.projectName);
|
|
43
|
+
devkit_1.logger.warn({ projectOutput });
|
|
44
|
+
const dockerCommand = `docker build --build-arg="APP_DIST=${projectOutput}" -f ${dockerfile} -t ${ecr} .`;
|
|
45
|
+
devkit_1.logger.warn({ dockerCommand });
|
|
46
|
+
try {
|
|
47
|
+
(0, child_process_1.execSync)(dockerCommand, { stdio });
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
devkit_1.logger.error({ error, detail: 'docker build failed' });
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
yield (0, push_image_to_ecr_wrapped_function_1.pushImageToECRWrapped)({ ecr, profile });
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
devkit_1.logger.error({ error, detail: 'docker push failed' });
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
if (region && cluster && service) {
|
|
61
|
+
try {
|
|
62
|
+
yield (0, restart_ecs_service_function_1.updateEcsService)({ profile, region, cluster, service });
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
devkit_1.logger.error({ error, detail: 'ECS service update failed' });
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
success: true,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
devkit_1.logger.error(error === null || error === void 0 ? void 0 : error.message);
|
|
75
|
+
devkit_1.logger.error({ error });
|
|
76
|
+
return {
|
|
77
|
+
success: false,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
exports.default = executor;
|
|
82
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/deploy-ecs/executor.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"title": "Db executor",
|
|
5
|
+
"description": "",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"ecr": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Name of the ECR repository and tag (conventionally separated by a colon)"
|
|
11
|
+
},
|
|
12
|
+
"dockerfile": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Path and name of the Dockerfile"
|
|
15
|
+
},
|
|
16
|
+
"profile": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "AWS profile name (which must be defined in the ~/.aws/credentials file) if AWS keys aren't defined as env vars"
|
|
19
|
+
},
|
|
20
|
+
"ui": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Name of the web/UI project to include in the assets included in the Docker image"
|
|
23
|
+
},
|
|
24
|
+
"cluster": { "type": "string", "description": "AWS cluster for identifying the ECS service to redeploy"},
|
|
25
|
+
"region": { "type": "string", "description": "AWS region for identifying the ECS service to redeploy"},
|
|
26
|
+
"service": { "type": "string", "description": "AWS service for identifying the ECS service to redeploy"},
|
|
27
|
+
},
|
|
28
|
+
"required": [
|
|
29
|
+
"ecr",
|
|
30
|
+
"dockerfile"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const extract_project_build_outputs_function_1 = require("../../functions/extract-project-build-outputs.function");
|
|
6
|
+
const deploy_lambda_function_1 = require("../../functions/deploy-lambda.function");
|
|
7
|
+
const pmx_function_1 = require("../../functions/pmx.function");
|
|
8
|
+
const pm_function_1 = require("../../functions/pm.function");
|
|
9
|
+
const executor_factory_function_1 = require("../../functions/executor-factory.function");
|
|
10
|
+
const stdio = 'inherit';
|
|
11
|
+
exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
+
const { functionName, region, bucket, profile, roleArn, environment, memorySize, delayMs, handler, runtime } = options;
|
|
13
|
+
const [apiProjectOutput] = (0, extract_project_build_outputs_function_1.extractProjectBuildOutputs)(context, context.projectName);
|
|
14
|
+
(0, pmx_function_1.pmxSpawn)(context, `nx build ${context.projectName}`);
|
|
15
|
+
(0, child_process_1.execSync)((0, pm_function_1.pm)(context).install, { stdio, cwd: apiProjectOutput });
|
|
16
|
+
yield (0, deploy_lambda_function_1.deployLambda)({ functionName: functionName || context.projectName, sourcePath: apiProjectOutput, region, bucket, roleArn, profile, environment, memorySize, delayMs, handler, runtime });
|
|
17
|
+
}));
|
|
18
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/deploy-lambda/executor.ts"],"names":[],"mappings":";;;AAEA,iDAAyC;AACzC,mHAAoG;AACpG,mFAAsE;AACtE,+DAAwD;AACxD,6DAAiD;AACjD,yFAA4E;AAE5E,MAAM,KAAK,GAAG,SAAS,CAAC;AAExB,kBAAe,IAAA,2CAAe,EAAC,CAC7B,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACvH,MAAM,CAAC,gBAAgB,CAAC,GAAG,IAAA,mEAA0B,EAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAEpF,IAAA,uBAAQ,EAAC,OAAO,EAAE,YAAY,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACrD,IAAA,wBAAQ,EAAC,IAAA,gBAAE,EAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAEhE,MAAM,IAAA,qCAAY,EAAC,EAAE,YAAY,EAAE,YAAY,IAAI,OAAO,CAAC,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AAEhM,CAAC,CAAA,CAAC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"title": "Deploy Lambda executor",
|
|
5
|
+
"description": "",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"bucket": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Name of the S3 bucket to use for uploading Lambda artifacts"
|
|
11
|
+
},
|
|
12
|
+
"functionName": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Name to use for lambda. Defaults to context.projectName for clarity"
|
|
15
|
+
},
|
|
16
|
+
"profile": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "AWS profile name (which must be defined in the ~/.aws/credentials file) if AWS keys aren't defined as env vars"
|
|
19
|
+
},
|
|
20
|
+
"region": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "AWS region for identifying the ECS service to redeploy"
|
|
23
|
+
},
|
|
24
|
+
"roleArn": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "AWS IAM role ARN the Lambda will assume"
|
|
27
|
+
},
|
|
28
|
+
"runtime": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "NodeJS runtime version"
|
|
31
|
+
},
|
|
32
|
+
"handler": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "Lambda handler resolution expression. Defaults to main.handler"
|
|
35
|
+
},
|
|
36
|
+
"memorySize": {
|
|
37
|
+
"type": "number",
|
|
38
|
+
"description": "Lambda allocated memory in MB"
|
|
39
|
+
},
|
|
40
|
+
"delayMs": {
|
|
41
|
+
"type": "number",
|
|
42
|
+
"description": "Delay in millis to wait after creating the Lambda (hacky)"
|
|
43
|
+
},
|
|
44
|
+
"environment": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
"description": "Environment variables structured as an object"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"required": [
|
|
53
|
+
"bucket",
|
|
54
|
+
"region",
|
|
55
|
+
"roleArn"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const executor_factory_function_1 = require("../../functions/executor-factory.function");
|
|
7
|
+
exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
8
|
+
const { envFile, ecr, port } = options;
|
|
9
|
+
const envFileExpression = envFile ? ` --env-file "${envFile}"` : '';
|
|
10
|
+
const command = `open http://localhost:${port} & docker run -p ${port}:${port} --env="PORT=${port}"${envFileExpression} "${ecr}"`;
|
|
11
|
+
devkit_1.logger.info(command);
|
|
12
|
+
(0, child_process_1.execSync)(command);
|
|
13
|
+
}));
|
|
14
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/docker-run/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AAErD,iDAAyC;AACzC,yFAA4E;AAE5E,kBAAe,IAAA,2CAAe,EAAC,CAC7B,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEvC,MAAM,iBAAiB,GAAG,OAAO,CAAC,CAAC,CAAC,gBAAgB,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACpE,MAAM,OAAO,GAAG,yBAAyB,IAAI,oBAAoB,IAAI,IAAI,IAAI,gBAAgB,IAAI,IAAI,iBAAiB,KAAK,GAAG,GAAG,CAAC;IAElI,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAErB,IAAA,wBAAQ,EAAC,OAAO,CAAC,CAAC;AACpB,CAAC,CAAA,CAAC,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/schema",
|
|
3
3
|
"version": 2,
|
|
4
|
-
"title": "
|
|
4
|
+
"title": "Docker-run executor",
|
|
5
5
|
"description": "",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"envFile": {
|
|
9
9
|
"type": "string",
|
|
10
10
|
"description": "Path and name of the .env file to load"
|
|
11
11
|
},
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"description": "Name of the ECR repository and tag (conventionally separated by a colon)"
|
|
15
15
|
},
|
|
16
16
|
"port": {
|
|
17
|
-
"type": "
|
|
17
|
+
"type": "number",
|
|
18
18
|
"description": "Port docker port to bind to localhost"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"required": [
|
|
22
|
-
"
|
|
22
|
+
"envFile", "ecr", "port"
|
|
23
23
|
]
|
|
24
24
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PromiseExecutor } from '@nx/devkit';
|
|
2
1
|
import { ExecutorSchema } from './schema';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
2
|
+
declare const _default: import("@nx/devkit").PromiseExecutor<ExecutorSchema>;
|
|
3
|
+
export default _default;
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
success: true,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
catch (error) {
|
|
18
|
-
return {
|
|
19
|
-
success: false,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
exports.default = runExecutor;
|
|
4
|
+
const load_env_file_function_1 = require("../../functions/load-env-file.function");
|
|
5
|
+
const executor_factory_function_1 = require("../../functions/executor-factory.function");
|
|
6
|
+
const pmx_function_1 = require("../../functions/pmx.function");
|
|
7
|
+
exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
8
|
+
const { debugPort, envFile } = options;
|
|
9
|
+
(0, load_env_file_function_1.loadEnvFile)(envFile);
|
|
10
|
+
const inspectStatement = debugPort ? `--port=${debugPort}` : '';
|
|
11
|
+
(0, pmx_function_1.pmxSpawn)(context, `nx run ${context.projectName}:serve ${inspectStatement}`);
|
|
12
|
+
}));
|
|
24
13
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/local/executor.ts"],"names":[],"mappings":";;;AAIA,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/local/executor.ts"],"names":[],"mappings":";;;AAIA,mFAAqE;AACrE,yFAA4E;AAC5E,+DAAwD;AAExD,kBAAe,IAAA,2CAAe,EAAC,CAC7B,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEvC,IAAA,oCAAW,EAAC,OAAO,CAAC,CAAC;IAErB,MAAM,gBAAgB,GAAG,SAAS,CAAC,CAAC,CAAC,UAAU,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEhE,IAAA,uBAAQ,EAAC,OAAO,EAAE,UAAU,OAAO,CAAC,WAAW,UAAU,gBAAgB,EAAE,CAAC,CAAC;AAC/E,CAAC,CAAA,CAAC,CAAC"}
|
|
@@ -5,21 +5,14 @@
|
|
|
5
5
|
"description": "",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"envPath": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"description": "Path and name of the .env file to load"
|
|
11
|
-
},
|
|
12
|
-
"envKey": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"description": "Name of the environment variable that points to the location of the envFile"
|
|
15
|
-
},
|
|
16
8
|
"debugPort": {
|
|
17
9
|
"type": "number",
|
|
18
10
|
"description": "Debug port"
|
|
11
|
+
},
|
|
12
|
+
"envFile": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Path and name of the .env file to load"
|
|
19
15
|
}
|
|
20
16
|
},
|
|
21
|
-
"required": [
|
|
22
|
-
"envPath",
|
|
23
|
-
"envKey"
|
|
24
|
-
]
|
|
17
|
+
"required": []
|
|
25
18
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const executor_factory_function_1 = require("../../functions/executor-factory.function");
|
|
6
|
+
exports.default = (0, executor_factory_function_1.executorFactory)((_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ flavor = 'typescript-axios', openapiJsonPath, outputPath }) {
|
|
7
|
+
(0, child_process_1.execSync)(`rm -rf ${outputPath}`, { stdio: 'inherit' });
|
|
8
|
+
(0, child_process_1.execSync)(`mkdir -p ${outputPath}`, { stdio: 'inherit' });
|
|
9
|
+
(0, child_process_1.execSync)(`docker run --rm -v .:/local openapitools/openapi-generator-cli:v6.3.0 generate -i local/${openapiJsonPath} -g ${flavor} -o local/${outputPath}`, { stdio: 'inherit' });
|
|
10
|
+
}));
|
|
11
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/openapi-gen/executor.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,yFAA4E;AAG5E,kBAAe,IAAA,2CAAe,EAAC,KAAqF,EAAE,oDAAhF,EAAE,MAAM,GAAG,kBAAkB,EAAE,eAAe,EAAE,UAAU,EAAkB;IAChH,IAAA,wBAAQ,EAAC,UAAU,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACvD,IAAA,wBAAQ,EAAC,YAAY,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACzD,IAAA,wBAAQ,EAAC,2FAA2F,eAAe,OAAO,MAAM,aAAa,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AACnL,CAAC,CAAA,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"title": "Openapi-gen executor",
|
|
5
|
+
"description": "",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"flavor": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Lowercase identifier corresponding to one of the predefined openapi generator target formats. Defaults to 'typescript-axios'."
|
|
11
|
+
},
|
|
12
|
+
"openapiJsonPath": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Path to the openapi definition JSON file (or yml file)."
|
|
15
|
+
},
|
|
16
|
+
"outputPath": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Path where the output of the openapi will be written."
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": [
|
|
22
|
+
"openapiJsonPath",
|
|
23
|
+
"outputPath"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PromiseExecutor } from '@nx/devkit';
|
|
2
1
|
import { ExecutorSchema } from './schema';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
2
|
+
declare const _default: import("@nx/devkit").PromiseExecutor<ExecutorSchema>;
|
|
3
|
+
export default _default;
|