@onivoro/onix 3.3.15 → 20.0.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.
Files changed (30) hide show
  1. package/executors.json +34 -4
  2. package/package.json +9 -5
  3. package/src/executors/build-cli/schema.d.ts +1 -1
  4. package/src/executors/db/schema.d.ts +1 -1
  5. package/src/executors/deploy/executor.js +8 -2
  6. package/src/executors/deploy/executor.js.map +1 -1
  7. package/src/executors/deploy/schema.d.ts +5 -6
  8. package/src/executors/docker/schema.d.ts +1 -1
  9. package/src/executors/gen/schema.d.ts +1 -1
  10. package/src/executors/local/schema.d.ts +1 -1
  11. package/src/executors/playwright/schema.d.ts +1 -1
  12. package/src/executors/vscode/schema.d.ts +1 -1
  13. package/src/functions/add-docker-deploy-target.function.d.ts +3 -0
  14. package/src/functions/add-docker-deploy-target.function.js +22 -0
  15. package/src/functions/add-docker-deploy-target.function.js.map +1 -0
  16. package/src/functions/add-docker-deploy-targets.function.d.ts +3 -0
  17. package/src/functions/add-docker-deploy-targets.function.js +10 -0
  18. package/src/functions/add-docker-deploy-targets.function.js.map +1 -0
  19. package/src/functions/add-gen-target.function.js +1 -1
  20. package/src/functions/add-gen-target.function.js.map +1 -1
  21. package/src/functions/build-onix-targets.function.js +2 -0
  22. package/src/functions/build-onix-targets.function.js.map +1 -1
  23. package/src/functions/push-image-to-ecr-wrapped.function.d.ts +4 -0
  24. package/src/functions/push-image-to-ecr-wrapped.function.js +14 -0
  25. package/src/functions/push-image-to-ecr-wrapped.function.js.map +1 -0
  26. package/src/functions/push-image-to-ecr.function.d.ts +8 -0
  27. package/src/functions/push-image-to-ecr.function.js +44 -0
  28. package/src/functions/push-image-to-ecr.function.js.map +1 -0
  29. package/src/types/onix-config.type.d.ts +2 -0
  30. package/README.md +0 -11
package/executors.json CHANGED
@@ -1,9 +1,39 @@
1
1
  {
2
2
  "executors": {
3
- "xxxx": {
4
- "implementation": "./src/executors/executor",
5
- "schema": "./src/executors/schema.json",
6
- "description": "xxxx executor"
3
+ "build-cli": {
4
+ "implementation": "./src/executors/build-cli/executor",
5
+ "schema": "./src/executors/build-cli/schema.json",
6
+ "description": "build-cli"
7
+ },
8
+ "orm": {
9
+ "implementation": "./src/executors/db/executor",
10
+ "schema": "./src/executors/db/schema.json",
11
+ "description": "db"
12
+ },
13
+ "docker-run": {
14
+ "implementation": "./src/executors/docker/executor",
15
+ "schema": "./src/executors/docker/schema.json",
16
+ "description": "docker-run"
17
+ },
18
+ "docker-deploy": {
19
+ "implementation": "./src/executors/deploy/executor",
20
+ "schema": "./src/executors/deploy/schema.json",
21
+ "description": "docker-deploy"
22
+ },
23
+ "gen-axios": {
24
+ "implementation": "./src/executors/gen/executor",
25
+ "schema": "./src/executors/gen/schema.json",
26
+ "description": "gen-axios"
27
+ },
28
+ "serve-locally": {
29
+ "implementation": "./src/executors/local/executor",
30
+ "schema": "./src/executors/local/schema.json",
31
+ "description": "serve-locally"
32
+ },
33
+ "playwright": {
34
+ "implementation": "./src/executors/playwright/executor",
35
+ "schema": "./src/executors/playwright/schema.json",
36
+ "description": "playwright"
7
37
  }
8
38
  }
9
39
  }
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@onivoro/onix",
3
- "version": "3.3.15",
4
- "dependencies": {
5
- "@nx/devkit": "20.0.6",
6
- "tslib": "^2.3.0"
7
- },
3
+ "version": "20.0.0",
8
4
  "type": "commonjs",
9
5
  "main": "./src/index.js",
10
6
  "typings": "./src/index.d.ts",
11
7
  "executors": "./executors.json",
8
+ "dependencies": {
9
+ "@aws-sdk/client-ecr": "^3.734.0",
10
+ "@aws-sdk/credential-providers": "^3.734.0",
11
+ "@nx/devkit": "^20.3.2",
12
+ "@nx/js": "20.3.2",
13
+ "esbuild": "^0.24.2",
14
+ "esbuild-node-externals": "^1.16.0"
15
+ },
12
16
  "types": "./src/index.d.ts"
13
17
  }
@@ -1,3 +1,3 @@
1
1
  export interface ExecutorSchema {
2
2
  moniker: string;
3
- } // eslint-disable-line
3
+ }
@@ -3,4 +3,4 @@ export interface ExecutorSchema {
3
3
  envKey: string;
4
4
  ormConfigPath: string;
5
5
  runOrRevert: string;
6
- } // eslint-disable-line
6
+ }
@@ -4,12 +4,18 @@ const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const child_process_1 = require("child_process");
6
6
  const executor = (options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
7
- const { envPath, ecr, prefix, profile } = options;
8
- // TODO: THROW IF AWS PROFILE HAS SPECIFIED PROFILE
7
+ const { envPath, ecr, prefix, profile, dockerfilePath } = options;
9
8
  try {
10
9
  const webProjectName = context.projectName.replace('api', 'web');
11
10
  const apiProjectPath = context.projectName.split('-').join('/').replace('app', 'apps').replace('appss', 'apps');
12
11
  const webProjectPath = apiProjectPath.replace('api', 'web').replace('app', 'apps').replace('appss', 'apps');
12
+ // build api
13
+ child_process_1.execSync;
14
+ // build ui if there's a ui project in onix.config
15
+ // copy ui dist to api dist/assets if there's ui project in onix.config
16
+ // login to docker
17
+ // push image
18
+ // restart cluster service
13
19
  const command = `export OSO_ENV=${envPath} && oso DeployImageAndUi -a ${context.projectName} -t production -p ${profile} -r us-east-2 -e ${ecr} -o ${apiProjectPath} -u ${webProjectName} -d dist/${webProjectPath} -f docker/prod/api/Dockerfile -g asdf && aws ecs update-service --cluster ${prefix}-cluster --service ${prefix}-service --force-new-deployment --profile ${profile} --region us-east-2`;
14
20
  devkit_1.logger.info(command);
15
21
  (0, child_process_1.execSync)(command, { stdio: 'inherit' });
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/deploy/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAsE;AAEtE,iDAAyC;AAEzC,MAAM,QAAQ,GAAoC,CAChD,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EA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-disable-line
1
+ import { TOnixEnvironmentConfig } from "onix/src/types/onix-config.type";
2
+
3
+ export interface ExecutorSchema extends TOnixEnvironmentConfig {
4
+
5
+ }
@@ -2,4 +2,4 @@ export interface ExecutorSchema {
2
2
  envPath: string;
3
3
  ecr: string;
4
4
  port: number;
5
- } // eslint-disable-line
5
+ }
@@ -1,3 +1,3 @@
1
1
  export interface ExecutorSchema {
2
2
  moniker: string;
3
- } // eslint-disable-line
3
+ }
@@ -2,4 +2,4 @@ export interface ExecutorSchema {
2
2
  envPath: string;
3
3
  envKey: string;
4
4
  port?: number;
5
- } // eslint-disable-line
5
+ }
@@ -1,2 +1,2 @@
1
1
  export interface ExecutorSchema {
2
- } // eslint-disable-line
2
+ }
@@ -1,2 +1,2 @@
1
1
  export interface ExecutorSchema {
2
- } // eslint-disable-line
2
+ }
@@ -0,0 +1,3 @@
1
+ import { TargetConfiguration } from "@nx/devkit";
2
+ import { TOnixEnvironmentConfig } from "../types/onix-config.type";
3
+ export declare function addDockerDeployTarget(environment: string, config: TOnixEnvironmentConfig, targets: Record<string, TargetConfiguration<any>>, projectJson: any, namedInputs: any): void;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addDockerDeployTarget = addDockerDeployTarget;
4
+ function addDockerDeployTarget(environment, config, targets, projectJson, namedInputs) {
5
+ const targetName = `onix-deploy-docker-${environment}`;
6
+ const { envPath, envKey, ecr, port, dockerfilePath } = config;
7
+ const command = `docker build -t ${ecr} -f ${dockerfilePath} . && docker push ${ecr}`;
8
+ if (ecr && dockerfilePath) {
9
+ targets[targetName] = {
10
+ command: `echo 'noop'`,
11
+ options: { cwd: process.cwd() },
12
+ cache: true,
13
+ inputs: [],
14
+ outputs: [],
15
+ metadata: {
16
+ technologies: ['Docker'],
17
+ description: `Builds the docker image locally and deploys it to the registry`,
18
+ },
19
+ };
20
+ }
21
+ }
22
+ //# sourceMappingURL=add-docker-deploy-target.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-docker-deploy-target.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/add-docker-deploy-target.function.ts"],"names":[],"mappings":";;AAGA,sDAmBC;AAnBD,SAAgB,qBAAqB,CAAC,WAAmB,EAAE,MAA8B,EAAE,OAAiD,EAAE,WAAgB,EAAE,WAAW;IACvK,MAAM,UAAU,GAAG,sBAAsB,WAAW,EAAE,CAAC;IACvD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAE9D,MAAM,OAAO,GAAG,mBAAmB,GAAG,OAAO,cAAc,qBAAqB,GAAG,EAAE,CAAC;IAEtF,IAAI,GAAG,IAAI,cAAc,EAAE,CAAC;QACxB,OAAO,CAAC,UAAU,CAAC,GAAG;YAClB,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE;YAC/B,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE;gBACN,YAAY,EAAE,CAAC,QAAQ,CAAC;gBACxB,WAAW,EAAE,gEAAgE;aAChF;SACJ,CAAC;IACN,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { TargetConfiguration } from "@nx/devkit";
2
+ import { TOnixConfig } from "../types/onix-config.type";
3
+ export declare function addDockerDeployTargets(onixConfig: TOnixConfig, targets: Record<string, TargetConfiguration<any>>, projectJson: any, namedInputs: any): void;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addDockerDeployTargets = addDockerDeployTargets;
4
+ const add_docker_deploy_target_function_1 = require("./add-docker-deploy-target.function");
5
+ function addDockerDeployTargets(onixConfig, targets, projectJson, namedInputs) {
6
+ Object.entries(onixConfig.environments || {}).forEach(([environment, config]) => {
7
+ (0, add_docker_deploy_target_function_1.addDockerDeployTarget)(environment, config, targets, projectJson, namedInputs);
8
+ });
9
+ }
10
+ //# sourceMappingURL=add-docker-deploy-targets.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-docker-deploy-targets.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/add-docker-deploy-targets.function.ts"],"names":[],"mappings":";;AAIA,wDAIG;AANH,2FAA4E;AAE5E,SAAgB,sBAAsB,CAAC,UAAuB,EAAE,OAAiD,EAAE,WAAgB,EAAE,WAAW;IAC5I,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE;QAC9E,IAAA,yDAAqB,EAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -6,7 +6,7 @@ function addGenTarget(onixConfig, targets, projectJson, namedInputs) {
6
6
  const { apiClientPath, apiDoxPath } = onixConfig;
7
7
  if (apiClientPath && apiDoxPath) {
8
8
  const targetName = `onix-generate-axios`;
9
- const command = `rm -rf ${apiClientPath}/src/lib && mkdir -p ${apiClientPath}/src/lib && docker run --rm -v .:/local openapitools/openapi-generator-cli:v6.3.0 generate -i local/${apiDoxPath} -g typescript-axios -o local/${apiClientPath}`;
9
+ const command = `rm -rf ${apiClientPath} && mkdir -p ${apiClientPath} && docker run --rm -v .:/local openapitools/openapi-generator-cli:v6.3.0 generate -i local/${apiDoxPath} -g typescript-axios -o local/${apiClientPath}`;
10
10
  targets[targetName] = {
11
11
  command,
12
12
  options: { cwd: process.cwd() },
@@ -1 +1 @@
1
- {"version":3,"file":"add-gen-target.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/add-gen-target.function.ts"],"names":[],"mappings":";;AAIA,oCA2BC;AA7BD,wFAA0E;AAE1E,SAAgB,YAAY,CAAC,UAAuB,EAAE,OAAiD,EAAE,WAAgB,EAAE,WAAW;IAClI,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;IAEjD,IAAI,aAAa,IAAI,UAAU,EAAE,CAAC;QAC9B,MAAM,UAAU,GAAG,qBAAqB,CAAC;QAEzC,MAAM,OAAO,GAAG,UAAU,aAAa,wBAAwB,aAAa,uGAAuG,UAAU,iCAAiC,aAAa,EAAE,CAAC;QAE9O,OAAO,CAAC,UAAU,CAAC,GAAG;YACpB,OAAO;YACP,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE;YAC/B,KAAK,EAAE,IAAI;YACX,SAAS,EAAE,CAAC,IAAI,4CAAe,EAAE,CAAC;YAClC,MAAM,EAAE;gBACN,GAAG,CAAC,YAAY,IAAI,WAAW;oBAC7B,CAAC,CAAC,CAAC,YAAY,EAAE,aAAa,CAAC;oBAC/B,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;gBAC5B;oBACE,oBAAoB,EAAE,EAAE;iBACzB;aACF;YACD,QAAQ,EAAE;gBACR,YAAY,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;gBACnC,WAAW,EAAE,8BAA8B;aAC5C;SACF,CAAC;IACN,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"add-gen-target.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/add-gen-target.function.ts"],"names":[],"mappings":";;AAIA,oCA2BC;AA7BD,wFAA0E;AAE1E,SAAgB,YAAY,CAAC,UAAuB,EAAE,OAAiD,EAAE,WAAgB,EAAE,WAAW;IAClI,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;IAEjD,IAAI,aAAa,IAAI,UAAU,EAAE,CAAC;QAC9B,MAAM,UAAU,GAAG,qBAAqB,CAAC;QAEzC,MAAM,OAAO,GAAG,UAAU,aAAa,gBAAgB,aAAa,+FAA+F,UAAU,iCAAiC,aAAa,EAAE,CAAC;QAE9N,OAAO,CAAC,UAAU,CAAC,GAAG;YACpB,OAAO;YACP,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE;YAC/B,KAAK,EAAE,IAAI;YACX,SAAS,EAAE,CAAC,IAAI,4CAAe,EAAE,CAAC;YAClC,MAAM,EAAE;gBACN,GAAG,CAAC,YAAY,IAAI,WAAW;oBAC7B,CAAC,CAAC,CAAC,YAAY,EAAE,aAAa,CAAC;oBAC/B,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;gBAC5B;oBACE,oBAAoB,EAAE,EAAE;iBACzB;aACF;YACD,QAAQ,EAAE;gBACR,YAAY,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;gBACnC,WAAW,EAAE,8BAA8B;aAC5C;SACF,CAAC;IACN,CAAC;AACL,CAAC"}
@@ -10,6 +10,7 @@ const add_serve_targets_function_1 = require("./add-serve-targets.function");
10
10
  const add_docker_targets_function_1 = require("./add-docker-targets.function");
11
11
  const add_db_targets_function_1 = require("./add-db-targets.function");
12
12
  const add_gen_target_function_1 = require("./add-gen-target.function");
13
+ const add_docker_deploy_targets_function_1 = require("./add-docker-deploy-targets.function");
13
14
  function buildOnixTargets(configFilePath, projectRoot, options, context) {
14
15
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
16
  const absoluteConfigFilePath = (0, devkit_1.joinPathFragments)(context.workspaceRoot, configFilePath);
@@ -22,6 +23,7 @@ function buildOnixTargets(configFilePath, projectRoot, options, context) {
22
23
  const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
23
24
  (0, add_serve_targets_function_1.addServeTargets)(onixConfig, targets, projectJson, namedInputs);
24
25
  (0, add_docker_targets_function_1.addDockerTargets)(onixConfig, targets, projectJson, namedInputs);
26
+ (0, add_docker_deploy_targets_function_1.addDockerDeployTargets)(onixConfig, targets, projectJson, namedInputs);
25
27
  (0, add_db_targets_function_1.addDbTargets)(onixConfig, targets, projectJson, namedInputs);
26
28
  (0, add_gen_target_function_1.addGenTarget)(onixConfig, targets, projectJson, namedInputs);
27
29
  const metadata = {};
@@ -1 +1 @@
1
- {"version":3,"file":"build-onix-targets.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/build-onix-targets.function.ts"],"names":[],"mappings":";;AAYA,4CA+BC;;AA3CD,uCAA2G;AAG3G,2BAAkC;AAElC,4EAAuE;AACvE,+BAA4B;AAC5B,6EAA+D;AAC/D,+EAAiE;AACjE,uEAAyD;AACzD,uEAAyD;AAEzD,SAAsB,gBAAgB,CAClC,cAAsB,EACtB,WAAmB,EACnB,OAA2B,EAC3B,OAA2B;;QAE3B,MAAM,sBAAsB,GAAG,IAAA,0BAAiB,EAC5C,OAAO,CAAC,aAAa,EACrB,cAAc,CACjB,CAAC;QAEF,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,aAAa,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QACjF,MAAM,WAAW,GAAG,IAAA,kBAAS,EAAC,IAAA,iBAAY,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;QAEtE,MAAM,OAAO,GAAwC,EAAE,CAAC;QAExD,eAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAEpC,MAAM,UAAU,GAAgB,OAAO,CAAC,sBAAsB,CAAC,CAAC;QAEhE,eAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAExB,MAAM,WAAW,GAAG,IAAA,iCAAc,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAEzD,IAAA,4CAAe,EAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAC/D,IAAA,8CAAgB,EAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAChE,IAAA,sCAAY,EAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAC5D,IAAA,sCAAY,EAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAE5D,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACjC,CAAC;CAAA"}
1
+ {"version":3,"file":"build-onix-targets.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/build-onix-targets.function.ts"],"names":[],"mappings":";;AAaA,4CAgCC;;AA7CD,uCAA2G;AAG3G,2BAAkC;AAElC,4EAAuE;AACvE,+BAA4B;AAC5B,6EAA+D;AAC/D,+EAAiE;AACjE,uEAAyD;AACzD,uEAAyD;AACzD,6FAA8E;AAE9E,SAAsB,gBAAgB,CAClC,cAAsB,EACtB,WAAmB,EACnB,OAA2B,EAC3B,OAA2B;;QAE3B,MAAM,sBAAsB,GAAG,IAAA,0BAAiB,EAC5C,OAAO,CAAC,aAAa,EACrB,cAAc,CACjB,CAAC;QAEF,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,aAAa,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QACjF,MAAM,WAAW,GAAG,IAAA,kBAAS,EAAC,IAAA,iBAAY,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;QAEtE,MAAM,OAAO,GAAwC,EAAE,CAAC;QAExD,eAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAEpC,MAAM,UAAU,GAAgB,OAAO,CAAC,sBAAsB,CAAC,CAAC;QAEhE,eAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAExB,MAAM,WAAW,GAAG,IAAA,iCAAc,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAEzD,IAAA,4CAAe,EAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAC/D,IAAA,8CAAgB,EAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAChE,IAAA,2DAAsB,EAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QACtE,IAAA,sCAAY,EAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAC5D,IAAA,sCAAY,EAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAE5D,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACjC,CAAC;CAAA"}
@@ -0,0 +1,4 @@
1
+ export declare function pushImageToECRWrapped(_: {
2
+ ecr: string;
3
+ profile: string;
4
+ }): Promise<void>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pushImageToECRWrapped = pushImageToECRWrapped;
4
+ const tslib_1 = require("tslib");
5
+ const push_image_to_ecr_function_1 = require("./push-image-to-ecr.function");
6
+ function pushImageToECRWrapped(_) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const { ecr, profile } = _;
9
+ const [registryId, region, repoColonTag] = ecr.replace('amazonaws.com', '').replace('dkr.ecr.', '').replace('/', '').split('.');
10
+ const [repositoryName, imageTag] = repoColonTag.split(':');
11
+ return yield (0, push_image_to_ecr_function_1.pushImageToECR)({ registryId, region, repositoryName, imageTag, profile });
12
+ });
13
+ }
14
+ //# sourceMappingURL=push-image-to-ecr-wrapped.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-image-to-ecr-wrapped.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/push-image-to-ecr-wrapped.function.ts"],"names":[],"mappings":";;AAEA,sDAMC;;AARD,6EAA8D;AAE9D,SAAsB,qBAAqB,CAAC,CAAmC;;QAC7E,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAC3B,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChI,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE3D,OAAO,MAAM,IAAA,2CAAc,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;CAAA"}
@@ -0,0 +1,8 @@
1
+ export interface PushImageConfig {
2
+ region: string;
3
+ repositoryName: string;
4
+ imageTag: string;
5
+ registryId: string;
6
+ profile: string;
7
+ }
8
+ export declare function pushImageToECR({ region, repositoryName, imageTag, registryId, profile }: PushImageConfig): Promise<void>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pushImageToECR = pushImageToECR;
4
+ const tslib_1 = require("tslib");
5
+ const client_ecr_1 = require("@aws-sdk/client-ecr");
6
+ const credential_providers_1 = require("@aws-sdk/credential-providers");
7
+ const child_process_1 = require("child_process");
8
+ function pushImageToECR(_a) {
9
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ region, repositoryName, imageTag, registryId, profile }) {
10
+ var _b, _c;
11
+ try {
12
+ const config = { region, credentials: (0, credential_providers_1.fromIni)({ profile }) };
13
+ const ecrClient = new client_ecr_1.ECRClient(config);
14
+ const authCommand = new client_ecr_1.GetAuthorizationTokenCommand({
15
+ registryIds: registryId ? [registryId] : undefined
16
+ });
17
+ const authResponse = yield ecrClient.send(authCommand);
18
+ if (!((_c = (_b = authResponse.authorizationData) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.authorizationToken)) {
19
+ throw new Error('Failed to get authorization token');
20
+ }
21
+ const authToken = Buffer.from(authResponse.authorizationData[0].authorizationToken, 'base64').toString('utf-8');
22
+ const [username, password] = authToken.split(':');
23
+ const registryEndpoint = authResponse.authorizationData[0].proxyEndpoint;
24
+ if (!registryEndpoint) {
25
+ throw new Error('Failed to get registry endpoint');
26
+ }
27
+ (0, child_process_1.execSync)('docker login ' +
28
+ `-u ${username} ` +
29
+ `-p ${password} ` +
30
+ registryEndpoint, { stdio: 'inherit' });
31
+ // Tag image
32
+ const remoteImage = `${registryEndpoint.replace('https://', '')}/${repositoryName}:${imageTag}`;
33
+ (0, child_process_1.execSync)(`docker tag ${repositoryName}:${imageTag} ${remoteImage}`, { stdio: 'inherit' });
34
+ // Push image
35
+ (0, child_process_1.execSync)(`docker push ${remoteImage}`, { stdio: 'inherit' });
36
+ console.log('Successfully pushed image to ECR');
37
+ }
38
+ catch (error) {
39
+ console.error('Error pushing image to ECR:', error);
40
+ throw error;
41
+ }
42
+ });
43
+ }
44
+ //# sourceMappingURL=push-image-to-ecr.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-image-to-ecr.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/push-image-to-ecr.function.ts"],"names":[],"mappings":";;AAYA,wCAsDC;;AAlED,oDAA+F;AAC/F,wEAAwD;AACxD,iDAAyC;AAUzC,SAAsB,cAAc;iEAAC,EACnC,MAAM,EACN,cAAc,EACd,QAAQ,EACR,UAAU,EACV,OAAO,EACS;;QAChB,IAAI,CAAC;YACH,MAAM,MAAM,GAAoB,EAAE,MAAM,EAAE,WAAW,EAAE,IAAA,8BAAO,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;YAC9E,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,MAAM,CAAC,CAAC;YAExC,MAAM,WAAW,GAAG,IAAI,yCAA4B,CAAC;gBACnD,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;aACnD,CAAC,CAAC;YACH,MAAM,YAAY,GAAG,MAAM,SAAS,C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AAC;YACf,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;YACpD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CAAA"}
@@ -6,6 +6,8 @@ export type TOnixEnvironmentConfig = {
6
6
  prefix: string;
7
7
  profile: string;
8
8
  ormConfigPath?: string;
9
+ dockerfilePath?: string;
10
+ webClientProjectPath?: string;
9
11
  };
10
12
  export type TOnixConfig = {
11
13
  moniker: string;
package/README.md DELETED
@@ -1,11 +0,0 @@
1
- # onix
2
-
3
- This library was generated with [Nx](https://nx.dev).
4
-
5
- ## Building
6
-
7
- Run `nx build onix` to build the library.
8
-
9
- ## Running unit tests
10
-
11
- Run `nx test onix` to execute the unit tests via [Jest](https://jestjs.io).