underpost 2.99.1 → 2.99.5
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/.env.development +0 -3
- package/.env.production +1 -3
- package/.env.test +0 -3
- package/LICENSE +1 -1
- package/README.md +30 -30
- package/baremetal/commission-workflows.json +52 -0
- package/bin/deploy.js +101 -47
- package/cli.md +47 -43
- package/examples/static-page/README.md +55 -378
- package/examples/static-page/ssr-components/CustomPage.js +1 -13
- package/jsconfig.json +4 -2
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +2 -2
- package/manifests/deployment/playwright/deployment.yaml +52 -0
- package/package.json +2 -2
- package/scripts/disk-devices.sh +13 -0
- package/scripts/rocky-pwa.sh +2 -2
- package/scripts/ssl.sh +12 -6
- package/src/api/user/user.model.js +1 -0
- package/src/cli/baremetal.js +576 -176
- package/src/cli/cloud-init.js +97 -79
- package/src/cli/deploy.js +6 -24
- package/src/cli/env.js +4 -1
- package/src/cli/image.js +7 -40
- package/src/cli/index.js +37 -7
- package/src/cli/repository.js +3 -1
- package/src/cli/run.js +109 -92
- package/src/cli/secrets.js +0 -34
- package/src/cli/static.js +0 -26
- package/src/cli/test.js +13 -1
- package/src/client/components/core/Polyhedron.js +896 -7
- package/src/client/components/core/Translate.js +4 -0
- package/src/client/services/default/default.management.js +12 -2
- package/src/index.js +27 -1
- package/src/runtime/express/Express.js +3 -3
- package/src/server/conf.js +6 -4
- package/src/server/logger.js +33 -31
- package/src/server/process.js +27 -2
- package/src/server/proxy.js +4 -6
- package/src/server/tls.js +30 -25
- package/examples/static-page/QUICK-REFERENCE.md +0 -481
- package/examples/static-page/STATIC-GENERATOR-GUIDE.md +0 -757
package/.env.development
CHANGED
|
@@ -16,9 +16,6 @@ DEFAULT_DEPLOY_PATH=/
|
|
|
16
16
|
MARIADB_HOST=changethis
|
|
17
17
|
MARIADB_USER=changethis
|
|
18
18
|
MARIADB_PASSWORD=changethis
|
|
19
|
-
DD_LAMPP_TEST_DB_0=changethis
|
|
20
|
-
WIFI=changethis
|
|
21
|
-
ROUTER=changethis
|
|
22
19
|
CLOUDINARY_CLOUD_NAME=changethis
|
|
23
20
|
CLOUDINARY_API_KEY=changethis
|
|
24
21
|
CLOUDINARY_API_SECRET=changethis
|
package/.env.production
CHANGED
|
@@ -17,9 +17,7 @@ DEFAULT_DEPLOY_PATH=/
|
|
|
17
17
|
MARIADB_HOST=changethis
|
|
18
18
|
MARIADB_USER=changethis
|
|
19
19
|
MARIADB_PASSWORD=changethis
|
|
20
|
-
|
|
21
|
-
WIFI=changethis
|
|
22
|
-
ROUTER=changethis
|
|
20
|
+
WIFI_PASSWORD=changethis
|
|
23
21
|
CLOUDINARY_CLOUD_NAME=changethis
|
|
24
22
|
CLOUDINARY_API_KEY=changethis
|
|
25
23
|
CLOUDINARY_API_SECRET=changethis
|
package/.env.test
CHANGED
|
@@ -16,9 +16,6 @@ DEFAULT_DEPLOY_PATH=/
|
|
|
16
16
|
MARIADB_HOST=changethis
|
|
17
17
|
MARIADB_USER=changethis
|
|
18
18
|
MARIADB_PASSWORD=changethis
|
|
19
|
-
DD_LAMPP_TEST_DB_0=changethis
|
|
20
|
-
WIFI=changethis
|
|
21
|
-
ROUTER=changethis
|
|
22
19
|
CLOUDINARY_CLOUD_NAME=changethis
|
|
23
20
|
CLOUDINARY_API_KEY=changethis
|
|
24
21
|
CLOUDINARY_API_SECRET=changethis
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<!-- badges -->
|
|
20
20
|
|
|
21
|
-
[](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://socket.dev/npm/package/underpost/overview/2.99.5) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
22
22
|
|
|
23
23
|
<!-- end-badges -->
|
|
24
24
|
|
|
@@ -66,42 +66,42 @@ Run dev client server
|
|
|
66
66
|
npm run dev
|
|
67
67
|
```
|
|
68
68
|
<!-- -->
|
|
69
|
-
## underpost ci/cd cli v2.99.
|
|
69
|
+
## underpost ci/cd cli v2.99.5
|
|
70
70
|
|
|
71
71
|
### Usage: `underpost [options] [command]`
|
|
72
72
|
```
|
|
73
73
|
Options:
|
|
74
|
-
-V, --version
|
|
75
|
-
-h, --help
|
|
74
|
+
-V, --version output the version number
|
|
75
|
+
-h, --help display help for command
|
|
76
76
|
|
|
77
77
|
Commands:
|
|
78
|
-
new [options] [app-name]
|
|
79
|
-
start [options] <deploy-id> [env]
|
|
80
|
-
clone [options] <uri>
|
|
81
|
-
pull [options] <path> <uri>
|
|
82
|
-
cmt [options] [path] [commit-type] [module-tag] [message]
|
|
83
|
-
push [options] <path> <uri>
|
|
84
|
-
env [deploy-id] [env] [subConf]
|
|
85
|
-
static [options]
|
|
86
|
-
config [options] <operator> [key] [value]
|
|
87
|
-
root
|
|
88
|
-
ip [options] [ips]
|
|
89
|
-
cluster [options] [pod-name]
|
|
90
|
-
deploy [options] [deploy-list] [env]
|
|
91
|
-
secret [options] <platform>
|
|
92
|
-
image [options]
|
|
93
|
-
install
|
|
94
|
-
db [options] [deploy-list]
|
|
95
|
-
metadata [options] [deploy-id] [host] [path]
|
|
96
|
-
cron [options] [deploy-list] [job-list]
|
|
97
|
-
fs [options] [path]
|
|
98
|
-
test [options] [deploy-list]
|
|
99
|
-
monitor [options] <deploy-id> [env]
|
|
78
|
+
new [options] [app-name] Initializes a new Underpost project, service, or configuration.
|
|
79
|
+
start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
|
|
80
|
+
clone [options] <uri> Clones a specified GitHub repository into the current directory.
|
|
81
|
+
pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
|
|
82
|
+
cmt [options] [path] [commit-type] [module-tag] [message] Manages commits to a GitHub repository, supporting various commit types and options.
|
|
83
|
+
push [options] <path> <uri> Pushes committed changes from a local repository to a remote GitHub repository.
|
|
84
|
+
env [deploy-id] [env] [subConf] Sets environment variables and configurations related to a specific deployment ID.
|
|
85
|
+
static [options] Manages static build of page, bundles, and documentation with comprehensive customization options.
|
|
86
|
+
config [options] <operator> [key] [value] Manages Underpost configurations using various operators.
|
|
87
|
+
root Displays the root path of the npm installation.
|
|
88
|
+
ip [options] [ips] Displays the current public machine IP addresses.
|
|
89
|
+
cluster [options] [pod-name] Manages Kubernetes clusters, defaulting to Kind cluster initialization.
|
|
90
|
+
deploy [options] [deploy-list] [env] Manages application deployments, defaulting to deploying development pods.
|
|
91
|
+
secret [options] <platform> Manages secrets for various platforms.
|
|
92
|
+
image [options] Manages Docker images, including building, saving, and loading into Kubernetes clusters.
|
|
93
|
+
install Quickly imports Underpost npm dependencies by copying them.
|
|
94
|
+
db [options] [deploy-list] Manages database operations with support for MariaDB and MongoDB, including import/export, multi-pod targeting, and Git integration.
|
|
95
|
+
metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
|
|
96
|
+
cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
|
|
97
|
+
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
|
98
|
+
test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
|
|
99
|
+
monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
|
|
100
100
|
ssh [options]
|
|
101
|
-
run [options] <runner-id> [path]
|
|
102
|
-
lxd [options]
|
|
103
|
-
baremetal [options] [workflow-id]
|
|
104
|
-
help [command]
|
|
101
|
+
run [options] <runner-id> [path] Runs specified scripts using various runners.
|
|
102
|
+
lxd [options] Manages LXD containers and virtual machines.
|
|
103
|
+
baremetal [options] [workflow-id] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
|
|
104
|
+
help [command] display help for command
|
|
105
105
|
|
|
106
106
|
```
|
|
107
107
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"rpi4mbarm64-iso-ram": {
|
|
3
3
|
"type": "iso-ram",
|
|
4
4
|
"osIdLike": "debian ubuntu",
|
|
5
|
+
"architecture": "arm64",
|
|
5
6
|
"isoUrl": "https://cdimage.ubuntu.com/releases/24.04/release/ubuntu-24.04.3-live-server-arm64.iso",
|
|
6
7
|
"tftpPrefix": "rpi4mb",
|
|
7
8
|
"bootstrapHttpServerPort": 8888,
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
"rpi4mbarm64-chroot": {
|
|
32
33
|
"type": "chroot-debootstrap",
|
|
33
34
|
"osIdLike": "debian ubuntu",
|
|
35
|
+
"architecture": "arm64",
|
|
34
36
|
"tftpPrefix": "rpi4mb",
|
|
35
37
|
"bootstrapHttpServerPort": 8888,
|
|
36
38
|
"menuentryStr": "UNDERPOST.NET UEFI/GRUB/MAAS RPi4 CHROOT commissioning (ARM64)",
|
|
@@ -65,6 +67,7 @@
|
|
|
65
67
|
"rpi4mbarm64-iso-nfs": {
|
|
66
68
|
"type": "iso-nfs",
|
|
67
69
|
"osIdLike": "debian ubuntu",
|
|
70
|
+
"architecture": "arm64",
|
|
68
71
|
"isoUrl": "https://cdimage.ubuntu.com/releases/24.04/release/ubuntu-24.04.3-live-server-arm64.iso",
|
|
69
72
|
"tftpPrefix": "rpi4mb",
|
|
70
73
|
"bootstrapHttpServerPort": 8888,
|
|
@@ -94,6 +97,7 @@
|
|
|
94
97
|
"rpi4mbarm64-chroot-rocky9": {
|
|
95
98
|
"type": "chroot-container",
|
|
96
99
|
"osIdLike": "rhel centos fedora",
|
|
100
|
+
"architecture": "arm64",
|
|
97
101
|
"tftpPrefix": "rpi4mb",
|
|
98
102
|
"bootstrapHttpServerPort": 8888,
|
|
99
103
|
"menuentryStr": "UNDERPOST.NET Rocky9 Container CHROOT NFS (ARM64)",
|
|
@@ -117,5 +121,53 @@
|
|
|
117
121
|
"keyboard": {
|
|
118
122
|
"layout": "es"
|
|
119
123
|
}
|
|
124
|
+
},
|
|
125
|
+
"hp-envy-iso-nfs": {
|
|
126
|
+
"type": "iso-nfs",
|
|
127
|
+
"osIdLike": "debian ubuntu",
|
|
128
|
+
"architecture": "amd64",
|
|
129
|
+
"isoUrl": "https://releases.ubuntu.com/releases/24.04/ubuntu-24.04.3-live-server-amd64.iso",
|
|
130
|
+
"tftpPrefix": "envy",
|
|
131
|
+
"bootstrapHttpServerPort": 8888,
|
|
132
|
+
"menuentryStr": "UNDERPOST.NET UEFI/ISO-IPXE/MAAS hp-envy ISO-NFS commissioning (AMD64)",
|
|
133
|
+
"networkInterfaceName": "eth0",
|
|
134
|
+
"chronyc": {
|
|
135
|
+
"timezone": "America/Santiago",
|
|
136
|
+
"chronyConfPath": "/etc/chrony/chrony.conf"
|
|
137
|
+
},
|
|
138
|
+
"firmwares": [],
|
|
139
|
+
"maas": {
|
|
140
|
+
"commissioning": {
|
|
141
|
+
"architecture": "amd64/hwe-24.04-edge",
|
|
142
|
+
"name": "ubuntu/noble"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"keyboard": {
|
|
146
|
+
"layout": "es"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"hp-envy-iso-ram": {
|
|
150
|
+
"type": "iso-ram",
|
|
151
|
+
"osIdLike": "debian ubuntu",
|
|
152
|
+
"architecture": "amd64",
|
|
153
|
+
"isoUrl": "https://releases.ubuntu.com/releases/24.04/ubuntu-24.04.3-live-server-amd64.iso",
|
|
154
|
+
"tftpPrefix": "envy",
|
|
155
|
+
"bootstrapHttpServerPort": 8888,
|
|
156
|
+
"menuentryStr": "UNDERPOST.NET UEFI/ISO-IPXE/MAAS hp-envy ISO-RAM commissioning (AMD64)",
|
|
157
|
+
"networkInterfaceName": "eth0",
|
|
158
|
+
"chronyc": {
|
|
159
|
+
"timezone": "America/Santiago",
|
|
160
|
+
"chronyConfPath": "/etc/chrony/chrony.conf"
|
|
161
|
+
},
|
|
162
|
+
"firmwares": [],
|
|
163
|
+
"maas": {
|
|
164
|
+
"commissioning": {
|
|
165
|
+
"architecture": "amd64/hwe-24.04-edge",
|
|
166
|
+
"name": "ubuntu/noble"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"keyboard": {
|
|
170
|
+
"layout": "es"
|
|
171
|
+
}
|
|
120
172
|
}
|
|
121
173
|
}
|
package/bin/deploy.js
CHANGED
|
@@ -241,7 +241,7 @@ try {
|
|
|
241
241
|
for (const relativePath of files) {
|
|
242
242
|
const filePah = `./engine-private/conf/${relativePath.replaceAll(`\\`, '/')}`;
|
|
243
243
|
if (filePah.split('/').pop() === 'package.json') {
|
|
244
|
-
const deployPackage = JSON.parse(fs.readFileSync(filePah
|
|
244
|
+
const deployPackage = JSON.parse(fs.readFileSync(filePah, 'utf8'));
|
|
245
245
|
deployPackage.dependencies = originPackage.dependencies;
|
|
246
246
|
deployPackage.devDependencies = originPackage.devDependencies;
|
|
247
247
|
fs.writeFileSync(filePah, JSON.stringify(deployPackage, null, 4), 'utf8');
|
|
@@ -468,7 +468,7 @@ try {
|
|
|
468
468
|
shellExec(`node bin new --deploy-id dd-default`);
|
|
469
469
|
console.log(fs.existsSync(`./engine-private/conf/dd-default`));
|
|
470
470
|
shellExec(`sudo rm -rf ./engine-private/conf/dd-default`);
|
|
471
|
-
shellExec(`node bin/deploy build-
|
|
471
|
+
shellExec(`node bin/deploy build-envs`);
|
|
472
472
|
break;
|
|
473
473
|
}
|
|
474
474
|
|
|
@@ -477,7 +477,7 @@ try {
|
|
|
477
477
|
shellExec(
|
|
478
478
|
`underpost secret underpost --create-from-file /home/dd/engine/engine-private/conf/dd-cron/.env.production`,
|
|
479
479
|
);
|
|
480
|
-
shellExec(`node bin/deploy sync-
|
|
480
|
+
shellExec(`node bin/deploy sync-envs`);
|
|
481
481
|
shellExec(`node bin/build dd conf`);
|
|
482
482
|
shellExec(`git add . && cd ./engine-private && git add .`);
|
|
483
483
|
shellExec(`node bin cmt . ci package-pwa-microservices-template 'New release v:${process.argv[3]}'`);
|
|
@@ -537,45 +537,6 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
537
537
|
|
|
538
538
|
break;
|
|
539
539
|
}
|
|
540
|
-
case 'build-env': {
|
|
541
|
-
const buildEnv = (privateEnvPath, originEnv, env) => {
|
|
542
|
-
const privateEnv = dotenv.parse(fs.readFileSync(privateEnvPath, 'utf8'));
|
|
543
|
-
for (const key of Object.keys(privateEnv)) {
|
|
544
|
-
if (key in env) {
|
|
545
|
-
console.warn(`Key ${key} already exists in origin env`);
|
|
546
|
-
continue;
|
|
547
|
-
}
|
|
548
|
-
if (key in originEnv) {
|
|
549
|
-
console.warn(`Key ${key} already exists in origin env`);
|
|
550
|
-
env[key] = originEnv[key];
|
|
551
|
-
continue;
|
|
552
|
-
}
|
|
553
|
-
env[key] =
|
|
554
|
-
`${key}`.toUpperCase().match('API') ||
|
|
555
|
-
`${key}`.toUpperCase().match('KEY') ||
|
|
556
|
-
`${key}`.toUpperCase().match('SECRET') ||
|
|
557
|
-
`${key}`.toUpperCase().match('TOKEN') ||
|
|
558
|
-
`${key}`.toUpperCase().match('PASSWORD') ||
|
|
559
|
-
`${key}`.toUpperCase().match('MAC')
|
|
560
|
-
? 'changethis'
|
|
561
|
-
: isNaN(parseFloat(privateEnv[key]))
|
|
562
|
-
? `${privateEnv[key]}`.match(`@`)
|
|
563
|
-
? 'admin@default.net'
|
|
564
|
-
: 'changethis'
|
|
565
|
-
: privateEnv[key];
|
|
566
|
-
}
|
|
567
|
-
return env;
|
|
568
|
-
};
|
|
569
|
-
for (let envPath of ['.env.development', '.env.production', '.env.test']) {
|
|
570
|
-
const originEnv = dotenv.parse(fs.readFileSync(`./${envPath}`, 'utf8'));
|
|
571
|
-
|
|
572
|
-
let env = {};
|
|
573
|
-
env = buildEnv(`./engine-private/conf/dd-cron/${envPath}`, originEnv, env);
|
|
574
|
-
env = buildEnv(`./engine-private/conf/dd-core/${envPath}`, originEnv, env);
|
|
575
|
-
writeEnv(envPath, env);
|
|
576
|
-
}
|
|
577
|
-
break;
|
|
578
|
-
}
|
|
579
540
|
|
|
580
541
|
case 'maas-db': {
|
|
581
542
|
// DROP, ALTER, CREATE, WITH ENCRYPTED
|
|
@@ -841,7 +802,7 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
841
802
|
const args = [
|
|
842
803
|
`node bin image --build --path ${path}/backend/`,
|
|
843
804
|
`--image-name=${imageName} --image-path=${path}`,
|
|
844
|
-
`--podman-save --${process.argv.includes('kubeadm') ? 'kubeadm' : 'kind'}
|
|
805
|
+
`--podman-save --${process.argv.includes('kubeadm') ? 'kubeadm' : 'kind'} --reset`,
|
|
845
806
|
];
|
|
846
807
|
shellExec(args.join(' '));
|
|
847
808
|
}
|
|
@@ -853,7 +814,7 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
853
814
|
const args = [
|
|
854
815
|
`node bin image --build --path ${path}/frontend/`,
|
|
855
816
|
`--image-name=${imageName} --image-path=${path}`,
|
|
856
|
-
`--podman-save --${process.argv.includes('kubeadm') ? 'kubeadm' : 'kind'}
|
|
817
|
+
`--podman-save --${process.argv.includes('kubeadm') ? 'kubeadm' : 'kind'} --reset`,
|
|
857
818
|
];
|
|
858
819
|
shellExec(args.join(' '));
|
|
859
820
|
}
|
|
@@ -1121,20 +1082,67 @@ nvidia/gpu-operator \
|
|
|
1121
1082
|
break;
|
|
1122
1083
|
}
|
|
1123
1084
|
|
|
1124
|
-
case '
|
|
1125
|
-
const
|
|
1085
|
+
case 'build-envs': {
|
|
1086
|
+
const buildEnv = (privateEnvPath, originEnv, env) => {
|
|
1087
|
+
const privateEnv = dotenv.parse(fs.readFileSync(privateEnvPath, 'utf8'));
|
|
1088
|
+
for (const key of Object.keys(privateEnv)) {
|
|
1089
|
+
if (key in env) {
|
|
1090
|
+
console.warn(`Key ${key} already exists in origin env`);
|
|
1091
|
+
continue;
|
|
1092
|
+
}
|
|
1093
|
+
if (key in originEnv) {
|
|
1094
|
+
console.warn(`Key ${key} already exists in origin env`);
|
|
1095
|
+
env[key] = originEnv[key];
|
|
1096
|
+
continue;
|
|
1097
|
+
}
|
|
1098
|
+
env[key] =
|
|
1099
|
+
`${key}`.toUpperCase().match('API') ||
|
|
1100
|
+
`${key}`.toUpperCase().match('KEY') ||
|
|
1101
|
+
`${key}`.toUpperCase().match('SECRET') ||
|
|
1102
|
+
`${key}`.toUpperCase().match('TOKEN') ||
|
|
1103
|
+
`${key}`.toUpperCase().match('PASSWORD') ||
|
|
1104
|
+
`${key}`.toUpperCase().match('MAC')
|
|
1105
|
+
? 'changethis'
|
|
1106
|
+
: isNaN(parseFloat(privateEnv[key]))
|
|
1107
|
+
? `${privateEnv[key]}`.match(`@`)
|
|
1108
|
+
? 'admin@default.net'
|
|
1109
|
+
: 'changethis'
|
|
1110
|
+
: privateEnv[key];
|
|
1111
|
+
}
|
|
1112
|
+
return env;
|
|
1113
|
+
};
|
|
1114
|
+
for (let envPath of ['.env.development', '.env.production', '.env.test']) {
|
|
1115
|
+
const originEnv = dotenv.parse(fs.readFileSync(`./${envPath}`, 'utf8'));
|
|
1116
|
+
|
|
1117
|
+
let env = {};
|
|
1118
|
+
env = buildEnv(`./engine-private/conf/dd-cron/${envPath}`, originEnv, env);
|
|
1119
|
+
env = buildEnv(`./engine-private/conf/dd-core/${envPath}`, originEnv, env);
|
|
1120
|
+
writeEnv(envPath, env);
|
|
1121
|
+
}
|
|
1122
|
+
break;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
case 'sync-envs': {
|
|
1126
1126
|
for (const deployId of ['dd-cron'].concat(
|
|
1127
1127
|
fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8').split(','),
|
|
1128
1128
|
)) {
|
|
1129
1129
|
for (const env of ['production', 'development', 'test']) {
|
|
1130
1130
|
const _envObj = dotenv.parse(fs.readFileSync(`./engine-private/conf/${deployId}/.env.${env}`, 'utf8'));
|
|
1131
|
-
|
|
1131
|
+
for (const env of []) {
|
|
1132
|
+
delete _envObj[env];
|
|
1133
|
+
}
|
|
1132
1134
|
writeEnv(`./engine-private/conf/${deployId}/.env.${env}`, _envObj);
|
|
1133
1135
|
}
|
|
1134
1136
|
}
|
|
1135
1137
|
break;
|
|
1136
1138
|
}
|
|
1137
1139
|
|
|
1140
|
+
case 'envs': {
|
|
1141
|
+
shellExec(`node bin/deploy sync-envs`);
|
|
1142
|
+
shellExec(`node bin/deploy build-envs`);
|
|
1143
|
+
break;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1138
1146
|
case 'cyberia': {
|
|
1139
1147
|
const { CyberiaDependencies } = await import(`../src/client/components/cyberia-portal/CommonCyberiaPortal.js`);
|
|
1140
1148
|
for (const dep of Object.keys(CyberiaDependencies)) {
|
|
@@ -1143,6 +1151,52 @@ nvidia/gpu-operator \
|
|
|
1143
1151
|
}
|
|
1144
1152
|
break;
|
|
1145
1153
|
}
|
|
1154
|
+
|
|
1155
|
+
case 'pw': {
|
|
1156
|
+
const help = `node bin/deploy pw <script-path> <from-path-in-pod> [to-path-on-local]`;
|
|
1157
|
+
const scriptPath = process.argv[3];
|
|
1158
|
+
const fromPath = process.argv[4];
|
|
1159
|
+
const toPath = process.argv[5] ? process.argv[5] : fromPath ? `/tmp/${fromPath.split('/').pop()}` : '';
|
|
1160
|
+
if (scriptPath === 'help') {
|
|
1161
|
+
logger.info(help);
|
|
1162
|
+
break;
|
|
1163
|
+
}
|
|
1164
|
+
if (fs.existsSync(toPath)) fs.removeSync(toPath);
|
|
1165
|
+
shellExec(`node bin/deploy pw-conf ${scriptPath}`);
|
|
1166
|
+
shellExec(`kubectl delete deployment playwright-server --ignore-not-found`);
|
|
1167
|
+
while (Underpost.deploy.get('playwright-server').length > 0) {
|
|
1168
|
+
logger.info(`Waiting for playwright-server deployment to be deleted...`);
|
|
1169
|
+
await timer(1000);
|
|
1170
|
+
}
|
|
1171
|
+
shellExec(`kubectl apply -f manifests/deployment/playwright/deployment.yaml`);
|
|
1172
|
+
const id = 'playwright-server';
|
|
1173
|
+
await Underpost.test.statusMonitor(id);
|
|
1174
|
+
const nameSpace = 'default';
|
|
1175
|
+
const [pod] = Underpost.deploy.get(id);
|
|
1176
|
+
const podName = pod.NAME;
|
|
1177
|
+
shellExec(`kubectl logs -f ${podName} -n ${nameSpace}`, {
|
|
1178
|
+
async: true,
|
|
1179
|
+
});
|
|
1180
|
+
(async () => {
|
|
1181
|
+
while (!Underpost.deploy.existsContainerFile({ podName, path: fromPath })) {
|
|
1182
|
+
await timer(1000);
|
|
1183
|
+
logger.info(`Waiting for file ${fromPath} in pod ${podName}...`);
|
|
1184
|
+
}
|
|
1185
|
+
shellExec(`sudo kubectl cp ${nameSpace}/${podName}:${fromPath} ${toPath}`);
|
|
1186
|
+
if (toPath.match('.png') && fs.existsSync(toPath)) shellExec(`firefox ${toPath}`);
|
|
1187
|
+
})();
|
|
1188
|
+
break;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
case 'pw-conf': {
|
|
1192
|
+
const scriptPath = process.argv[3];
|
|
1193
|
+
shellExec(`kubectl delete configmap playwright-script`);
|
|
1194
|
+
shellExec(`kubectl create configmap playwright-script \
|
|
1195
|
+
--from-file=script.js=${scriptPath} \
|
|
1196
|
+
--dry-run=client -o yaml | kubectl apply -f -
|
|
1197
|
+
`);
|
|
1198
|
+
break;
|
|
1199
|
+
}
|
|
1146
1200
|
}
|
|
1147
1201
|
} catch (error) {
|
|
1148
1202
|
logger.error(error, error.stack);
|
package/cli.md
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.99.
|
|
1
|
+
## underpost ci/cd cli v2.99.5
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
5
5
|
Options:
|
|
6
|
-
-V, --version
|
|
7
|
-
-h, --help
|
|
6
|
+
-V, --version output the version number
|
|
7
|
+
-h, --help display help for command
|
|
8
8
|
|
|
9
9
|
Commands:
|
|
10
|
-
new [options] [app-name]
|
|
11
|
-
start [options] <deploy-id> [env]
|
|
12
|
-
clone [options] <uri>
|
|
13
|
-
pull [options] <path> <uri>
|
|
14
|
-
cmt [options] [path] [commit-type] [module-tag] [message]
|
|
15
|
-
push [options] <path> <uri>
|
|
16
|
-
env [deploy-id] [env] [subConf]
|
|
17
|
-
static [options]
|
|
18
|
-
config [options] <operator> [key] [value]
|
|
19
|
-
root
|
|
20
|
-
ip [options] [ips]
|
|
21
|
-
cluster [options] [pod-name]
|
|
22
|
-
deploy [options] [deploy-list] [env]
|
|
23
|
-
secret [options] <platform>
|
|
24
|
-
image [options]
|
|
25
|
-
install
|
|
26
|
-
db [options] [deploy-list]
|
|
27
|
-
metadata [options] [deploy-id] [host] [path]
|
|
28
|
-
cron [options] [deploy-list] [job-list]
|
|
29
|
-
fs [options] [path]
|
|
30
|
-
test [options] [deploy-list]
|
|
31
|
-
monitor [options] <deploy-id> [env]
|
|
10
|
+
new [options] [app-name] Initializes a new Underpost project, service, or configuration.
|
|
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] [subConf] Sets environment variables and configurations related to a specific deployment ID.
|
|
17
|
+
static [options] Manages static build of page, bundles, and documentation with comprehensive customization options.
|
|
18
|
+
config [options] <operator> [key] [value] Manages Underpost configurations using various operators.
|
|
19
|
+
root Displays the root path of the npm installation.
|
|
20
|
+
ip [options] [ips] Displays the current public machine IP addresses.
|
|
21
|
+
cluster [options] [pod-name] Manages Kubernetes clusters, defaulting to Kind cluster initialization.
|
|
22
|
+
deploy [options] [deploy-list] [env] Manages application deployments, defaulting to deploying development pods.
|
|
23
|
+
secret [options] <platform> Manages secrets for various platforms.
|
|
24
|
+
image [options] Manages Docker images, including building, saving, and loading into Kubernetes clusters.
|
|
25
|
+
install Quickly imports Underpost npm dependencies by copying them.
|
|
26
|
+
db [options] [deploy-list] Manages database operations with support for MariaDB and MongoDB, including import/export, multi-pod targeting, and Git integration.
|
|
27
|
+
metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
|
|
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
32
|
ssh [options]
|
|
33
|
-
run [options] <runner-id> [path]
|
|
34
|
-
lxd [options]
|
|
35
|
-
baremetal [options] [workflow-id]
|
|
36
|
-
help [command]
|
|
33
|
+
run [options] <runner-id> [path] Runs specified scripts using various runners.
|
|
34
|
+
lxd [options] Manages LXD containers and virtual machines.
|
|
35
|
+
baremetal [options] [workflow-id] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
|
|
36
|
+
help [command] display help for command
|
|
37
37
|
|
|
38
38
|
```
|
|
39
39
|
|
|
@@ -243,12 +243,6 @@ Options:
|
|
|
243
243
|
--manifest <path> Web manifest path.
|
|
244
244
|
--head-components <paths> Comma-separated SSR head component paths.
|
|
245
245
|
--body-components <paths> Comma-separated SSR body component paths.
|
|
246
|
-
--deploy-id <deploy-id> Build static assets for a specific deployment
|
|
247
|
-
ID.
|
|
248
|
-
--build Triggers the static build process for the
|
|
249
|
-
specified deployment ID.
|
|
250
|
-
--build-host <build-host> Sets a custom build host for static documents or
|
|
251
|
-
assets.
|
|
252
246
|
--build-path <build-path> Sets a custom build path for static documents or
|
|
253
247
|
assets.
|
|
254
248
|
--env <env> Sets the environment for the static build (e.g.,
|
|
@@ -286,6 +280,8 @@ Options:
|
|
|
286
280
|
--deploy-id <deploy-id> Sets the deployment configuration ID for the
|
|
287
281
|
operation context.
|
|
288
282
|
--build Sets the build context for the operation.
|
|
283
|
+
--copy Copies the configuration value to the clipboard
|
|
284
|
+
(only for get operation).
|
|
289
285
|
-h, --help display help for command
|
|
290
286
|
|
|
291
287
|
```
|
|
@@ -495,7 +491,7 @@ Manages secrets for various platforms.
|
|
|
495
491
|
|
|
496
492
|
Arguments:
|
|
497
493
|
platform The secret management platform. Options:
|
|
498
|
-
|
|
494
|
+
underpost.
|
|
499
495
|
|
|
500
496
|
Options:
|
|
501
497
|
--init Initializes the secrets platform
|
|
@@ -546,10 +542,6 @@ Options:
|
|
|
546
542
|
management.
|
|
547
543
|
--node-name Set node name for kubeadm or k3s cluster
|
|
548
544
|
env image context management.
|
|
549
|
-
--secrets Includes Dockerfile environment secrets
|
|
550
|
-
during the build.
|
|
551
|
-
--secrets-path [secrets-path] Specifies a custom path for Dockerfile
|
|
552
|
-
environment secrets.
|
|
553
545
|
--reset Performs a build without using the
|
|
554
546
|
cache.
|
|
555
547
|
--dev Use development mode.
|
|
@@ -800,7 +792,7 @@ Options:
|
|
|
800
792
|
Runs specified scripts using various runners.
|
|
801
793
|
|
|
802
794
|
Arguments:
|
|
803
|
-
runner-id The runner ID to run. Options: dev-cluster,metadata,svc-ls,svc-rm,ssh-deploy-info,dev-hosts-expose,dev-hosts-restore,cluster-build,template-deploy,template-deploy-image,clean,pull,release-deploy,ssh-deploy,ide,crypto-policy,sync,stop,ssh-deploy-stop,ssh-deploy-db-rollback,ssh-deploy-db,ssh-deploy-db-status,tz,cron,get-proxy,instance-promote,instance,ls-deployments,host-update,dd-container,ip-info,
|
|
795
|
+
runner-id The runner ID to run. Options: dev-cluster,metadata,svc-ls,svc-rm,ssh-deploy-info,dev-hosts-expose,dev-hosts-restore,cluster-build,template-deploy,template-deploy-image,clean,pull,release-deploy,ssh-deploy,ide,crypto-policy,sync,stop,ssh-deploy-stop,ssh-deploy-db-rollback,ssh-deploy-db,ssh-deploy-db-status,tz,cron,get-proxy,instance-promote,instance,ls-deployments,host-update,dd-container,ip-info,db-client,git-conf,promote,metrics,cluster,deploy,disk-clean,disk-devices,disk-usage,dev,service,etc-hosts,sh,log,ps,ptls,release-cmt,deploy-test,sync-replica,tf-vae-test,spark-template,rmi,kill,secret,underpost-config,gpu-env,tf-gpu-test,deploy-job.
|
|
804
796
|
path The input value, identifier, or path for the operation.
|
|
805
797
|
|
|
806
798
|
Options:
|
|
@@ -858,6 +850,11 @@ Options:
|
|
|
858
850
|
--retry-count <count> Sets HTTPProxy per-route retry count (e.g., 3).
|
|
859
851
|
--retry-per-try-timeout <duration> Sets HTTPProxy retry per-try timeout (e.g., "150ms").
|
|
860
852
|
--disable-private-conf-update Disables updates to private configuration during execution.
|
|
853
|
+
--logs Streams logs during the runner execution.
|
|
854
|
+
--monitor-status <status> Sets the status to monitor for pod/resource (default: "Running").
|
|
855
|
+
--monitor-status-kind-type <kind-type> Sets the Kubernetes resource kind type to monitor (default: "pods").
|
|
856
|
+
--monitor-status-delta-ms <milliseconds> Sets the polling interval in milliseconds for status monitoring (default: 1000).
|
|
857
|
+
--monitor-status-max-attempts <attempts> Sets the maximum number of status check attempts (default: 600).
|
|
861
858
|
-h, --help display help for command
|
|
862
859
|
|
|
863
860
|
```
|
|
@@ -915,12 +912,18 @@ Options:
|
|
|
915
912
|
|
|
916
913
|
### `baremetal` :
|
|
917
914
|
```
|
|
918
|
-
Usage: underpost baremetal [options] [workflow-id]
|
|
915
|
+
Usage: underpost baremetal [options] [workflow-id]
|
|
919
916
|
|
|
920
917
|
Manages baremetal server operations, including installation, database setup,
|
|
921
918
|
commissioning, and user management.
|
|
922
919
|
|
|
923
920
|
Options:
|
|
921
|
+
--ip-address <ip-address> The IP address of the control server or the local machine.
|
|
922
|
+
--hostname <hostname> The hostname of the target baremetal machine.
|
|
923
|
+
--ip-file-server <ip-file-server> The IP address of the file server (NFS/TFTP).
|
|
924
|
+
--ip-config <ip-config> IP configuration string for the baremetal machine.
|
|
925
|
+
--netmask <netmask> Netmask of network.
|
|
926
|
+
--dns-server <dns-server> DNS server IP address.
|
|
924
927
|
--control-server-install Installs the baremetal control server.
|
|
925
928
|
--control-server-uninstall Uninstalls the baremetal control server.
|
|
926
929
|
--control-server-restart Restarts the baremetal control server.
|
|
@@ -930,6 +933,7 @@ Options:
|
|
|
930
933
|
--mac <mac> Specifies the MAC address for baremetal machine operations. Use "random" for random MAC, "hardware" to use device's actual MAC (no spoofing), or specify a MAC address.
|
|
931
934
|
--ipxe Chainloads iPXE to normalize identity before commissioning.
|
|
932
935
|
--ipxe-rebuild Forces rebuild of iPXE binary with embedded boot script.
|
|
936
|
+
--ipxe-build-iso <iso-path> Builds a standalone iPXE ISO with embedded script for the specified workflow ID.
|
|
933
937
|
--install-packer Installs Packer CLI.
|
|
934
938
|
--packer-maas-image-template <template-path> Creates a new image folder from canonical/packer-maas template path (requires workflow-id).
|
|
935
939
|
--packer-workflow-id <workflow-id> Specifies the workflow ID for Packer MAAS image operations.
|
|
@@ -955,7 +959,7 @@ Options:
|
|
|
955
959
|
--rocky-tools-test Tests rocky linux tools in chroot environment.
|
|
956
960
|
--bootcmd <bootcmd-list> Comma-separated list of boot commands to execute.
|
|
957
961
|
--runcmd <runcmd-list> Comma-separated list of run commands to execute.
|
|
958
|
-
--logs <log-id> Displays logs for log id: dhcp,
|
|
962
|
+
--logs <log-id> Displays logs for log id: dhcp,dhcp-lease,dhcp-lan,cloud-init,cloud-init-machine,cloud-init-config
|
|
959
963
|
--dev Sets the development context environment for baremetal operations.
|
|
960
964
|
--ls Lists available boot resources and machines.
|
|
961
965
|
-h, --help display help for command
|