underpost 2.8.861 → 2.8.867

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/cli.md CHANGED
@@ -1,63 +1,63 @@
1
- ## underpost ci/cd cli v2.8.861
1
+ ## underpost ci/cd cli v2.8.867
2
2
 
3
3
  ### Usage: `underpost [options] [command]`
4
-
5
- ```
6
- Options:
7
- -V, --version output the version number
8
- -h, --help display help for command
4
+ ```
5
+ Options:
6
+ -V, --version output the version number
7
+ -h, --help display help for command
9
8
 
10
9
  Commands:
11
- new [options] <app-name> Initializes a new Underpost project with a predefined structure.
12
- start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
13
- clone [options] <uri> Clones a specified GitHub repository into the current directory.
14
- pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
15
- cmt [options] <path> <commit-type> [module-tag] [message] Manages commits to a GitHub repository, supporting various commit types and options.
16
- push [options] <path> <uri> Pushes committed changes from a local repository to a remote GitHub repository.
17
- env <deploy-id> [env] Sets environment variables and configurations related to a specific deployment ID.
18
- config [options] <operator> [key] [value] Manages Underpost configurations using various operators.
19
- root Displays the root path of the npm installation.
20
- cluster [options] [pod-name] Manages Kubernetes clusters, defaulting to Kind cluster initialization.
21
- deploy [options] [deploy-list] [env] Manages application deployments, defaulting to deploying development pods.
22
- secret [options] <platform> Manages secrets for various platforms.
23
- dockerfile-image-build [options] Builds a Docker image from a specified Dockerfile with various options for naming, saving, and loading.
24
- dockerfile-pull-base-images [options] Pulls required Underpost Dockerfile base images and optionally loads them into clusters.
25
- install Quickly imports Underpost npm dependencies by copying them.
26
- db [options] <deploy-list> Manages database operations, including import, export, and collection management.
27
- metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
28
- script [options] <operator> <script-name> [script-value] Supports a variety of built-in Underpost global scripts, their preset lifecycle events, and arbitrary custom scripts.
29
- cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
30
- fs [options] [path] Manages file storage, defaulting to file upload operations.
31
- test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
32
- monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
33
- ssh [options] Import and start ssh server and client based on current default deployment ID.
34
- run [options] <runner-id> [path] Runs a script from the specified path.
35
- lxd [options] Manages LXD containers and virtual machines.
36
- baremetal [options] [workflow-id] [hostname] [ip-address] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
37
- help [command] display help for command
38
-
10
+ new [options] <app-name> Initializes a new Underpost project with a predefined structure.
11
+ start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
12
+ clone [options] <uri> Clones a specified GitHub repository into the current directory.
13
+ pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
14
+ cmt [options] <path> <commit-type> [module-tag] [message] Manages commits to a GitHub repository, supporting various commit types and options.
15
+ push [options] <path> <uri> Pushes committed changes from a local repository to a remote GitHub repository.
16
+ env <deploy-id> [env] Sets environment variables and configurations related to a specific deployment ID.
17
+ config [options] <operator> [key] [value] Manages Underpost configurations using various operators.
18
+ root Displays the root path of the npm installation.
19
+ cluster [options] [pod-name] Manages Kubernetes clusters, defaulting to Kind cluster initialization.
20
+ deploy [options] [deploy-list] [env] Manages application deployments, defaulting to deploying development pods.
21
+ secret [options] <platform> Manages secrets for various platforms.
22
+ dockerfile-image-build [options] Builds a Docker image from a specified Dockerfile with various options for naming, saving, and loading.
23
+ dockerfile-pull-base-images [options] Pulls required Underpost Dockerfile base images and optionally loads them into clusters.
24
+ install Quickly imports Underpost npm dependencies by copying them.
25
+ db [options] <deploy-list> Manages database operations, including import, export, and collection management.
26
+ metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
27
+ script [options] <operator> <script-name> [script-value] Supports a variety of built-in Underpost global scripts, their preset lifecycle events, and arbitrary custom scripts.
28
+ cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
29
+ fs [options] [path] Manages file storage, defaulting to file upload operations.
30
+ test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
31
+ monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
32
+ ssh [options] Import and start ssh server and client based on current default deployment ID.
33
+ run [options] <runner-id> [path] Runs a script from the specified path.
34
+ lxd [options] Manages LXD containers and virtual machines.
35
+ baremetal [options] [workflow-id] [hostname] [ip-address] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
36
+ help [command] display help for command
37
+
39
38
  ```
40
39
 
41
40
  ## Commands:
41
+
42
42
 
43
43
  ### `new` :
44
-
45
44
  ```
46
45
  Usage: underpost new [options] <app-name>
47
46
 
48
47
  Initializes a new Underpost project with a predefined structure.
49
48
 
50
49
  Arguments:
51
- app-name The name of the application to create.
50
+ app-name The name or deploy-id of the application to create.
52
51
 
53
52
  Options:
54
- --dev Sets the development cli context
55
- -h, --help display help for command
56
-
53
+ --deploy-id Crete deploy ID conf env files
54
+ --dev Sets the development cli context
55
+ -h, --help display help for command
56
+
57
57
  ```
58
+
58
59
 
59
60
  ### `start` :
60
-
61
61
  ```
62
62
  Usage: underpost start [options] <deploy-id> [env]
63
63
 
@@ -73,11 +73,11 @@ Options:
73
73
  --run Starts application servers and monitors their health.
74
74
  --build Triggers the client-side application build process.
75
75
  -h, --help display help for command
76
-
76
+
77
77
  ```
78
+
78
79
 
79
80
  ### `clone` :
80
-
81
81
  ```
82
82
  Usage: underpost clone [options] <uri>
83
83
 
@@ -90,11 +90,11 @@ Options:
90
90
  --bare Performs a bare clone, downloading only the .git files.
91
91
  -g8 Uses the g8 repository extension for cloning.
92
92
  -h, --help display help for command
93
-
93
+
94
94
  ```
95
+
95
96
 
96
97
  ### `pull` :
97
-
98
98
  ```
99
99
  Usage: underpost pull [options] <path> <uri>
100
100
 
@@ -108,11 +108,11 @@ Arguments:
108
108
  Options:
109
109
  -g8 Uses the g8 repository extension for pulling.
110
110
  -h, --help display help for command
111
-
111
+
112
112
  ```
113
+
113
114
 
114
115
  ### `cmt` :
115
-
116
116
  ```
117
117
  Usage: underpost cmt [options] <path> <commit-type> [module-tag] [message]
118
118
 
@@ -132,11 +132,11 @@ Options:
132
132
  --copy Copies the generated commit message to the clipboard.
133
133
  --info Displays information about available commit types.
134
134
  -h, --help display help for command
135
-
135
+
136
136
  ```
137
+
137
138
 
138
139
  ### `push` :
139
-
140
140
  ```
141
141
  Usage: underpost push [options] <path> <uri>
142
142
 
@@ -150,11 +150,11 @@ Options:
150
150
  -f Forces the push, overwriting the remote repository history.
151
151
  -g8 Uses the g8 repository extension for pushing.
152
152
  -h, --help display help for command
153
-
153
+
154
154
  ```
155
+
155
156
 
156
157
  ### `env` :
157
-
158
158
  ```
159
159
  Usage: underpost env [options] <deploy-id> [env]
160
160
 
@@ -169,11 +169,11 @@ Arguments:
169
169
 
170
170
  Options:
171
171
  -h, --help display help for command
172
-
172
+
173
173
  ```
174
+
174
175
 
175
176
  ### `config` :
176
-
177
177
  ```
178
178
  Usage: underpost config [options] <operator> [key] [value]
179
179
 
@@ -188,11 +188,11 @@ Arguments:
188
188
  Options:
189
189
  --plain Prints the configuration value in plain text.
190
190
  -h, --help display help for command
191
-
191
+
192
192
  ```
193
+
193
194
 
194
195
  ### `root` :
195
-
196
196
  ```
197
197
  Usage: underpost root [options]
198
198
 
@@ -200,11 +200,11 @@ Displays the root path of the npm installation.
200
200
 
201
201
  Options:
202
202
  -h, --help display help for command
203
-
203
+
204
204
  ```
205
+
205
206
 
206
207
  ### `cluster` :
207
-
208
208
  ```
209
209
  Usage: underpost cluster [options] [pod-name]
210
210
 
@@ -261,11 +261,11 @@ Options:
261
261
  --k3s Initializes the cluster using K3s (Lightweight
262
262
  Kubernetes).
263
263
  -h, --help display help for command
264
-
264
+
265
265
  ```
266
+
266
267
 
267
268
  ### `deploy` :
268
-
269
269
  ```
270
270
  Usage: underpost deploy [options] [deploy-list] [env]
271
271
 
@@ -291,6 +291,8 @@ Options:
291
291
  management commands.
292
292
  --cert Resets TLS/SSL certificate secrets for
293
293
  deployments.
294
+ --node <node> Sets optional node for deployment
295
+ operations.
294
296
  --build-manifest Builds Kubernetes YAML manifests, including
295
297
  deployments, services, proxies, and
296
298
  secrets.
@@ -307,11 +309,11 @@ Options:
307
309
  operations.
308
310
  --restore-hosts Restores default `/etc/hosts` entries.
309
311
  -h, --help display help for command
310
-
312
+
311
313
  ```
314
+
312
315
 
313
316
  ### `secret` :
314
-
315
317
  ```
316
318
  Usage: underpost secret [options] <platform>
317
319
 
@@ -329,11 +331,11 @@ Options:
329
331
  --list Lists all available secrets for the
330
332
  platform.
331
333
  -h, --help display help for command
332
-
334
+
333
335
  ```
336
+
334
337
 
335
338
  ### `dockerfile-image-build` :
336
-
337
339
  ```
338
340
  Usage: underpost dockerfile-image-build [options]
339
341
 
@@ -360,11 +362,11 @@ Options:
360
362
  cache.
361
363
  --k3s-load Loads the image into a K3s cluster.
362
364
  -h, --help display help for command
363
-
365
+
364
366
  ```
367
+
365
368
 
366
369
  ### `dockerfile-pull-base-images` :
367
-
368
370
  ```
369
371
  Usage: underpost dockerfile-pull-base-images [options]
370
372
 
@@ -378,11 +380,11 @@ Options:
378
380
  --version Sets a custom version for the base images.
379
381
  --k3s-load Loads the image into a K3s cluster.
380
382
  -h, --help display help for command
381
-
383
+
382
384
  ```
385
+
383
386
 
384
387
  ### `install` :
385
-
386
388
  ```
387
389
  Usage: underpost install [options]
388
390
 
@@ -390,11 +392,11 @@ Quickly imports Underpost npm dependencies by copying them.
390
392
 
391
393
  Options:
392
394
  -h, --help display help for command
393
-
395
+
394
396
  ```
397
+
395
398
 
396
399
  ### `db` :
397
-
398
400
  ```
399
401
  Usage: underpost db [options] <deploy-list>
400
402
 
@@ -424,11 +426,11 @@ Options:
424
426
  --ns <ns-name> Optional: Specifies the namespace context for
425
427
  database operations.
426
428
  -h, --help display help for command
427
-
429
+
428
430
  ```
431
+
429
432
 
430
433
  ### `metadata` :
431
-
432
434
  ```
433
435
  Usage: underpost metadata [options] [deploy-id] [host] [path]
434
436
 
@@ -447,11 +449,11 @@ Options:
447
449
  --generate Generate cluster metadata
448
450
  --itc Apply under container execution context
449
451
  -h, --help display help for command
450
-
452
+
451
453
  ```
454
+
452
455
 
453
456
  ### `script` :
454
-
455
457
  ```
456
458
  Usage: underpost script [options] <operator> <script-name> [script-value]
457
459
 
@@ -473,11 +475,11 @@ Options:
473
475
  execution.
474
476
  --pod-name <pod-name> Optional: Specifies the pod name for script execution.
475
477
  -h, --help display help for command
476
-
478
+
477
479
  ```
480
+
478
481
 
479
482
  ### `cron` :
480
-
481
483
  ```
482
484
  Usage: underpost cron [options] [deploy-list] [job-list]
483
485
 
@@ -495,11 +497,11 @@ Options:
495
497
  --init Initializes cron jobs for the default deployment ID.
496
498
  --git Uploads cron job configurations to GitHub.
497
499
  -h, --help display help for command
498
-
500
+
499
501
  ```
502
+
500
503
 
501
504
  ### `fs` :
502
-
503
505
  ```
504
506
  Usage: underpost fs [options] [path]
505
507
 
@@ -517,11 +519,11 @@ Options:
517
519
  --force Forces the action, overriding any warnings or conflicts.
518
520
  --storage-file-path <storage-file-path> Specifies a custom file storage path.
519
521
  -h, --help display help for command
520
-
522
+
521
523
  ```
524
+
522
525
 
523
526
  ### `test` :
524
-
525
527
  ```
526
528
  Usage: underpost test [options] [deploy-list]
527
529
 
@@ -543,11 +545,11 @@ Options:
543
545
  --kind-type <kind-type> Optional: Specifies the Kind cluster type for
544
546
  tests.
545
547
  -h, --help display help for command
546
-
548
+
547
549
  ```
550
+
548
551
 
549
552
  ### `monitor` :
550
-
551
553
  ```
552
554
  Usage: underpost monitor [options] <deploy-id> [env]
553
555
 
@@ -570,11 +572,11 @@ Options:
570
572
  --sync Synchronizes with current proxy deployments and
571
573
  traffic configurations.
572
574
  -h, --help display help for command
573
-
575
+
574
576
  ```
577
+
575
578
 
576
579
  ### `ssh` :
577
-
578
580
  ```
579
581
  Usage: underpost ssh [options]
580
582
 
@@ -584,18 +586,18 @@ Options:
584
586
  --generate Generates new ssh credential and stores it in current private
585
587
  keys file storage.
586
588
  -h, --help display help for command
587
-
589
+
588
590
  ```
591
+
589
592
 
590
593
  ### `run` :
591
-
592
594
  ```
593
595
  Usage: underpost run [options] <runner-id> [path]
594
596
 
595
597
  Runs a script from the specified path.
596
598
 
597
599
  Arguments:
598
- runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, ssh-cluster-info, cyberia-ide, engine-ide, template-deploy, clean, pull, release-deploy, ssh-deploy, ide, dev-client, dev-api, monitor, db-client, promote, metrics, cluster, deploy, tf-vae-test, deploy-job.
600
+ runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, ssh-cluster-info, cyberia-ide, engine-ide, template-deploy, clean, pull, release-deploy, ssh-deploy, ide, dev-client, dev-api, router-sync, monitor, db-client, promote, metrics, cluster, deploy, tf-vae-test, deploy-job.
599
601
  path The absolute or relative directory path where the script is located.
600
602
 
601
603
  Options:
@@ -610,11 +612,11 @@ Options:
610
612
  --container-name <container-name> Optional: Specifies the container name for test execution.
611
613
  --namespace <namespace> Optional: Specifies the namespace for test execution.
612
614
  -h, --help display help for command
613
-
615
+
614
616
  ```
617
+
615
618
 
616
619
  ### `lxd` :
617
-
618
620
  ```
619
621
  Usage: underpost lxd [options]
620
622
 
@@ -655,11 +657,11 @@ Options:
655
657
  --auto-expose-k8s-ports <vm-id> Automatically exposes common Kubernetes
656
658
  ports for the specified VM.
657
659
  -h, --help display help for command
658
-
660
+
659
661
  ```
662
+
660
663
 
661
664
  ### `baremetal` :
662
-
663
665
  ```
664
666
  Usage: underpost baremetal [options] [workflow-id] [hostname] [ip-address]
665
667
 
@@ -693,5 +695,6 @@ Options:
693
695
  baremetal operations.
694
696
  --ls Lists available boot resources and machines.
695
697
  -h, --help display help for command
696
-
698
+
697
699
  ```
700
+
package/conf.js CHANGED
@@ -130,7 +130,7 @@ const DefaultConf = /**/ {
130
130
  ssr: {
131
131
  Default: {
132
132
  head: ['Seo', 'Pwa', 'Css', 'DefaultScripts', 'Production'],
133
- body: ['CacheControl', 'DefaultSplashScreen', '404', '500'],
133
+ body: ['CacheControl', 'DefaultSplashScreen'],
134
134
  mailer: { userVerifyEmail: 'DefaultVerifyEmail', userRecoverEmail: 'DefaultRecoverEmail' },
135
135
  offline: [
136
136
  { path: '/offline', title: 'No Network Connection', client: 'NoNetworkConnection', head: [], body: [] },
@@ -17,7 +17,7 @@ spec:
17
17
  spec:
18
18
  containers:
19
19
  - name: dd-default-development-blue
20
- image: localhost/rockylinux9-underpost:v2.8.861
20
+ image: localhost/rockylinux9-underpost:v2.8.867
21
21
  # resources:
22
22
  # requests:
23
23
  # memory: "124Ki"
@@ -100,7 +100,7 @@ spec:
100
100
  spec:
101
101
  containers:
102
102
  - name: dd-default-development-green
103
- image: localhost/rockylinux9-underpost:v2.8.861
103
+ image: localhost/rockylinux9-underpost:v2.8.867
104
104
  # resources:
105
105
  # requests:
106
106
  # memory: "124Ki"
package/package.json CHANGED
@@ -2,13 +2,13 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "underpost",
5
- "version": "2.8.861",
5
+ "version": "2.8.867",
6
6
  "description": "pwa api rest template",
7
7
  "scripts": {
8
8
  "start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
9
9
  "build": "node bin/deploy build-full-client",
10
10
  "test": "env-cmd -f .env.test c8 mocha",
11
- "pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine",
11
+ "pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine -- dd-default",
12
12
  "dev": "env-cmd -f .env.development nodemon src/server",
13
13
  "dev-img": "env-cmd -f .env.development node src/server",
14
14
  "prod-img": "env-cmd -f .env.production node src/server",
@@ -683,17 +683,9 @@ net.ipv4.ip_forward = 1' | sudo tee ${iptableConfPath}`,
683
683
  }
684
684
  },
685
685
 
686
- /**
687
- * @method getResourcesCapacity
688
- * @description Retrieves and returns the allocatable CPU and memory resources
689
- * of the Kubernetes node.
690
- * @param {boolean} [isKubeadmOrK3s=false] - If true, assumes a kubeadm or k3s-managed node;
691
- * otherwise, assumes a Kind worker node.
692
- * @returns {object} An object containing CPU and memory resources with values and units.
693
- */
694
- getResourcesCapacity(isKubeadmOrK3s = false) {
686
+ getResourcesCapacity(node) {
695
687
  const resources = {};
696
- const nodeName = isKubeadmOrK3s ? os.hostname() : 'kind-worker';
688
+ const nodeName = node ?? os.hostname();
697
689
  const info = shellExec(`kubectl describe node ${nodeName} | grep -E '(Allocatable:|Capacity:)' -A 6`, {
698
690
  stdout: true,
699
691
  silent: true,
package/src/cli/deploy.js CHANGED
@@ -22,13 +22,13 @@ const logger = loggerFactory(import.meta);
22
22
  class UnderpostDeploy {
23
23
  static NETWORK = {};
24
24
  static API = {
25
- sync(deployList, { versions, replicas, kubeadm = false }) {
25
+ sync(deployList, { versions, replicas, node }) {
26
26
  const deployGroupId = 'dd.router';
27
27
  fs.writeFileSync(`./engine-private/deploy/${deployGroupId}`, deployList, 'utf8');
28
28
  const totalPods = deployList.split(',').length * versions.split(',').length * parseInt(replicas);
29
29
  const limitFactor = 0.8;
30
30
  const reserveFactor = 0.05;
31
- const resources = UnderpostCluster.API.getResourcesCapacity(kubeadm);
31
+ const resources = UnderpostCluster.API.getResourcesCapacity(node);
32
32
  const memory = parseInt(resources.memory.value / totalPods);
33
33
  const cpu = parseInt(resources.cpu.value / totalPods);
34
34
  UnderpostRootEnv.API.set(
@@ -49,7 +49,7 @@ class UnderpostDeploy {
49
49
  const initEnvObj = dotenv.parse(fs.readFileSync(initEnvPath, 'utf8'));
50
50
  process.env.PORT = initEnvObj.PORT;
51
51
  process.env.NODE_ENV = env;
52
- await Config.build(undefined, 'proxy', deployList);
52
+ await Config.build('proxy', deployList);
53
53
  return buildPortProxyRouter(env === 'development' ? 80 : 443, buildProxyRouter());
54
54
  },
55
55
  deploymentYamlServiceFactory({ deployId, env, port, deploymentVersions }) {
@@ -243,6 +243,7 @@ spec:
243
243
  versions: '',
244
244
  traffic: '',
245
245
  replicas: '',
246
+ node: '',
246
247
  restoreHosts: false,
247
248
  disableUpdateDeployment: false,
248
249
  infoTraffic: false,
package/src/cli/index.js CHANGED
@@ -22,7 +22,8 @@ program.name('underpost').description(`underpost ci/cd cli ${Underpost.version}`
22
22
  // 'new' command: Create a new project
23
23
  program
24
24
  .command('new')
25
- .argument('<app-name>', 'The name of the application to create.')
25
+ .argument('<app-name>', 'The name or deploy-id of the application to create.')
26
+ .option('--deploy-id', 'Crete deploy ID conf env files')
26
27
  .option('--dev', 'Sets the development cli context')
27
28
  .description('Initializes a new Underpost project with a predefined structure.')
28
29
  .action(Underpost.repo.new);
@@ -157,6 +158,7 @@ program
157
158
  .option('--expose', 'Exposes services matching the provided deployment ID list.')
158
159
  .option('--info-util', 'Displays useful `kubectl` utility management commands.')
159
160
  .option('--cert', 'Resets TLS/SSL certificate secrets for deployments.')
161
+ .option('--node <node>', 'Sets optional node for deployment operations.')
160
162
  .option(
161
163
  '--build-manifest',
162
164
  'Builds Kubernetes YAML manifests, including deployments, services, proxies, and secrets.',
@@ -5,6 +5,7 @@ import { actionInitLog, loggerFactory } from '../server/logger.js';
5
5
  import fs from 'fs-extra';
6
6
  import { getNpmRootPath } from '../server/conf.js';
7
7
  import UnderpostStartUp from '../server/start.js';
8
+ import { Config } from '../server/conf.js';
8
9
 
9
10
  dotenv.config();
10
11
 
@@ -80,15 +81,16 @@ class UnderpostRepository {
80
81
  );
81
82
  },
82
83
 
83
- new(repositoryName, options = { dev: false }) {
84
+ new(repositoryName, options = { dev: false, deployId: false }) {
84
85
  return new Promise(async (resolve, reject) => {
85
86
  try {
86
87
  await logger.setUpInfo();
88
+ actionInitLog();
87
89
  if (repositoryName === 'service')
88
90
  return resolve(
89
91
  await UnderpostStartUp.API.listenPortController(UnderpostStartUp.API.listenServerFactory(), ':'),
90
92
  );
91
- else actionInitLog();
93
+ if (options.deployId === true) return Config.deployIdFactory(repositoryName);
92
94
  const npmRoot = getNpmRootPath();
93
95
  const underpostRoot = options?.dev === true ? '.' : `${npmRoot}/underpost`;
94
96
  const destFolder = `./${repositoryName}`;
package/src/cli/run.js CHANGED
@@ -141,6 +141,14 @@ class UnderpostRun {
141
141
  let [deployId, subConf] = path.split(',');
142
142
  shellExec(`npm run dev-api ${deployId} ${subConf}`);
143
143
  },
144
+ 'router-sync': (path, options = UnderpostRun.DEFAULT_OPTION) => {
145
+ const baseCommand = options.dev || true ? 'node bin' : 'underpost';
146
+ const defaultPaht = ['dd', 'kind-control-plane'];
147
+ let [deployId, node] = path ? path.split(',') : defaultPaht;
148
+ deployId = deployId ?? defaultPaht[0];
149
+ node = node ?? defaultPaht[1];
150
+ shellExec(`${baseCommand} deploy --sync --node ${node} --build-manifest --info-router ${deployId} production`);
151
+ },
144
152
  monitor: (path, options = UnderpostRun.DEFAULT_OPTION) => {
145
153
  const pid = getTerminalPid();
146
154
  logger.info('monitor pid', pid);