underpost 2.8.65 → 2.8.67
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/.vscode/extensions.json +3 -2
- package/.vscode/settings.json +2 -0
- package/CHANGELOG.md +24 -4
- package/README.md +39 -2
- package/bin/deploy.js +1180 -144
- package/bin/file.js +8 -0
- package/bin/index.js +1 -240
- package/cli.md +451 -0
- package/docker-compose.yml +1 -1
- package/jsdoc.json +1 -1
- package/manifests/calico-custom-resources.yaml +25 -0
- package/manifests/deployment/adminer/deployment.yaml +32 -0
- package/manifests/deployment/adminer/kustomization.yaml +7 -0
- package/manifests/deployment/adminer/service.yaml +13 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +1 -1
- package/manifests/postgresql/configmap.yaml +9 -0
- package/manifests/postgresql/kustomization.yaml +10 -0
- package/manifests/postgresql/pv.yaml +15 -0
- package/manifests/postgresql/pvc.yaml +13 -0
- package/manifests/postgresql/service.yaml +10 -0
- package/manifests/postgresql/statefulset.yaml +37 -0
- package/manifests/valkey/statefulset.yaml +6 -4
- package/package.json +2 -1
- package/src/cli/cluster.js +69 -10
- package/src/cli/deploy.js +55 -8
- package/src/cli/fs.js +14 -3
- package/src/cli/index.js +312 -0
- package/src/cli/monitor.js +93 -39
- package/src/client/components/core/JoyStick.js +2 -2
- package/src/client/components/core/Modal.js +1 -0
- package/src/index.js +1 -1
- package/src/server/client-build.js +13 -0
- package/src/server/conf.js +5 -1
- package/src/server/dns.js +47 -17
- package/src/server/runtime.js +2 -0
- package/src/server/start.js +0 -1
package/bin/file.js
CHANGED
|
@@ -136,6 +136,14 @@ try {
|
|
|
136
136
|
JSON.stringify(templatePackageLockJson, null, 4),
|
|
137
137
|
'utf8',
|
|
138
138
|
);
|
|
139
|
+
const splitKeyword = '## underpost ci/cd cli';
|
|
140
|
+
fs.writeFileSync(
|
|
141
|
+
`../pwa-microservices-template/README.md`,
|
|
142
|
+
fs.readFileSync(`../pwa-microservices-template/README.md`, 'utf8').split(`<!-- -->`)[0] +
|
|
143
|
+
`<!-- -->
|
|
144
|
+
${splitKeyword + fs.readFileSync(`./README.md`, 'utf8').split(splitKeyword)[1]}`,
|
|
145
|
+
'utf8',
|
|
146
|
+
);
|
|
139
147
|
}
|
|
140
148
|
|
|
141
149
|
break;
|
package/bin/index.js
CHANGED
|
@@ -1,244 +1,5 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { Command } from 'commander';
|
|
5
|
-
import Underpost from '../src/index.js';
|
|
6
|
-
import { getUnderpostRootPath, loadConf } from '../src/server/conf.js';
|
|
7
|
-
import fs from 'fs-extra';
|
|
8
|
-
import { commitData } from '../src/client/components/core/CommonJs.js';
|
|
9
|
-
|
|
10
|
-
const underpostRootPath = getUnderpostRootPath();
|
|
11
|
-
fs.existsSync(`${underpostRootPath}/.env`)
|
|
12
|
-
? dotenv.config({ path: `${underpostRootPath}/.env`, override: true })
|
|
13
|
-
: dotenv.config();
|
|
14
|
-
|
|
15
|
-
const program = new Command();
|
|
16
|
-
|
|
17
|
-
program.name('underpost').description(`underpost ci/cd cli ${Underpost.version}`).version(Underpost.version);
|
|
18
|
-
|
|
19
|
-
program
|
|
20
|
-
.command('new')
|
|
21
|
-
.argument('<app-name>', 'Application name')
|
|
22
|
-
.description('Create a new project')
|
|
23
|
-
.action(Underpost.repo.new);
|
|
24
|
-
|
|
25
|
-
program
|
|
26
|
-
.command('start')
|
|
27
|
-
.argument('<deploy-id>', 'Deploy configuration id')
|
|
28
|
-
.argument('[env]', 'Optional environment, for default is development')
|
|
29
|
-
.option('--run', 'Run app servers and monitor health server')
|
|
30
|
-
.option('--build', 'Build app client')
|
|
31
|
-
.action(Underpost.start.callback)
|
|
32
|
-
.description('Start up server, build pipelines, or services');
|
|
33
|
-
|
|
34
|
-
program
|
|
35
|
-
.command('clone')
|
|
36
|
-
.argument(`<uri>`, 'e.g. username/repository')
|
|
37
|
-
.option('--bare', 'Clone only .git files')
|
|
38
|
-
.description('Clone github repository')
|
|
39
|
-
.action(Underpost.repo.clone);
|
|
40
|
-
|
|
41
|
-
program
|
|
42
|
-
.command('pull')
|
|
43
|
-
.argument('<path>', 'Absolute or relative directory')
|
|
44
|
-
.argument(`<uri>`, 'e.g. username/repository')
|
|
45
|
-
.description('Pull github repository')
|
|
46
|
-
.action(Underpost.repo.pull);
|
|
47
|
-
|
|
48
|
-
program
|
|
49
|
-
.command('cmt')
|
|
50
|
-
.argument('<path>', 'Absolute or relative directory')
|
|
51
|
-
.argument(`<commit-type>`, `Options: ${Object.keys(commitData)}`)
|
|
52
|
-
.argument(`[module-tag]`, 'Optional set module tag')
|
|
53
|
-
.argument(`[message]`, 'Optional set additional message')
|
|
54
|
-
.option('--empty', 'Allow empty files')
|
|
55
|
-
.option('--copy', 'Copy to clipboard message')
|
|
56
|
-
.option('--info', 'Info commit types')
|
|
57
|
-
.description('Commit github repository')
|
|
58
|
-
.action(Underpost.repo.commit);
|
|
59
|
-
|
|
60
|
-
program
|
|
61
|
-
.command('push')
|
|
62
|
-
.argument('<path>', 'Absolute or relative directory')
|
|
63
|
-
.argument(`<uri>`, 'e.g. username/repository')
|
|
64
|
-
.option('-f', 'Force push overwriting repository')
|
|
65
|
-
.description('Push github repository')
|
|
66
|
-
.action(Underpost.repo.push);
|
|
67
|
-
|
|
68
|
-
program
|
|
69
|
-
.command('env')
|
|
70
|
-
.argument('<deploy-id>', `deploy configuration id, if 'clean' restore default`)
|
|
71
|
-
.argument('[env]', 'Optional environment, for default is production')
|
|
72
|
-
.description('Set environment variables files and conf related to <deploy-id>')
|
|
73
|
-
.action(loadConf);
|
|
74
|
-
|
|
75
|
-
program
|
|
76
|
-
.command('config')
|
|
77
|
-
.argument('operator', `Options: ${Object.keys(Underpost.env)}`)
|
|
78
|
-
.argument('[key]', 'Config key')
|
|
79
|
-
.argument('[value]', 'Config value')
|
|
80
|
-
.description(`Manage configuration, operators`)
|
|
81
|
-
.action((...args) => Underpost.env[args[0]](args[1], args[2]));
|
|
82
|
-
|
|
83
|
-
program
|
|
84
|
-
.command('root')
|
|
85
|
-
.description('Get npm root path')
|
|
86
|
-
.action(() => console.log(getNpmRootPath()));
|
|
87
|
-
|
|
88
|
-
program
|
|
89
|
-
.command('cluster')
|
|
90
|
-
.argument('[pod-name]', 'Optional pod name filter')
|
|
91
|
-
.option('--reset', `Delete all clusters and prune all data and caches`)
|
|
92
|
-
.option('--mariadb', 'Init with mariadb statefulset')
|
|
93
|
-
.option('--mongodb', 'Init with mongodb statefulset')
|
|
94
|
-
.option('--mongodb4', 'Init with mongodb 4.4 service')
|
|
95
|
-
.option('--valkey', 'Init with valkey service')
|
|
96
|
-
.option('--contour', 'Init with project contour base HTTPProxy and envoy')
|
|
97
|
-
.option('--cert-manager', 'Init with letsencrypt-prod ClusterIssuer')
|
|
98
|
-
.option('--info', 'Get all kinds objects deployed')
|
|
99
|
-
.option('--full', 'Init with all statefulsets and services available')
|
|
100
|
-
.option('--ns-use <ns-name>', 'Switches current context to namespace')
|
|
101
|
-
.option('--dev', 'init with dev cluster')
|
|
102
|
-
.option('--list-pods', 'Display list pods information')
|
|
103
|
-
.option('--info-capacity', 'display current total machine capacity info')
|
|
104
|
-
.option('--info-capacity-pod', 'display current machine capacity pod info')
|
|
105
|
-
.action(Underpost.cluster.init)
|
|
106
|
-
.description('Manage cluster, for default initialization base kind cluster');
|
|
107
|
-
|
|
108
|
-
program
|
|
109
|
-
.command('deploy')
|
|
110
|
-
.argument('<deploy-list>', 'Deploy id list, e.g. default-a,default-b')
|
|
111
|
-
.argument('[env]', 'Optional environment, for default is development')
|
|
112
|
-
.option('--remove', 'Delete deployments and services')
|
|
113
|
-
.option('--sync', 'Sync deployments env, ports, and replicas')
|
|
114
|
-
.option('--info-router', 'Display router structure')
|
|
115
|
-
.option('--expose', 'Expose service match deploy-list')
|
|
116
|
-
.option('--info-util', 'Display kubectl util management commands')
|
|
117
|
-
.option('--cert', 'Reset tls/ssl certificate secrets')
|
|
118
|
-
.option('--build-manifest', 'Build kind yaml manifests: deployments, services, proxy and secrets')
|
|
119
|
-
.option('--dashboard-update', 'Update dashboard instance data with current router config')
|
|
120
|
-
.option('--replicas <replicas>', 'Set custom number of replicas')
|
|
121
|
-
.option('--versions <deployment-versions>', 'Comma separated custom deployment versions')
|
|
122
|
-
.option('--traffic <traffic-versions>', 'Comma separated custom deployment traffic')
|
|
123
|
-
.description('Manage deployment, for default deploy development pods')
|
|
124
|
-
.action(Underpost.deploy.callback);
|
|
125
|
-
|
|
126
|
-
program
|
|
127
|
-
.command('secret')
|
|
128
|
-
.argument('<platform>', `Options: ${Object.keys(Underpost.secret)}`)
|
|
129
|
-
.option('--init', 'Init secrets platform environment')
|
|
130
|
-
.option('--create-from-file <path-env-file>', 'Create secret from env file')
|
|
131
|
-
.option('--list', 'Lists secrets')
|
|
132
|
-
// .option('--delete [secret-key]', 'Delete key secret, if not set, are default delete all')
|
|
133
|
-
// .option('--create [secret-key] [secret-value]', 'Create secret key, with secret value')
|
|
134
|
-
.description(`Manage secrets`)
|
|
135
|
-
.action((...args) => {
|
|
136
|
-
if (args[1].createFromFile) return Underpost.secret[args[0]].createFromEnvFile(args[1].createFromFile);
|
|
137
|
-
if (args[1].list) return Underpost.secret[args[0]].list();
|
|
138
|
-
if (args[1].init) return Underpost.secret[args[0]].init();
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
program
|
|
142
|
-
.command('dockerfile-image-build')
|
|
143
|
-
.option('--path [path]', 'Dockerfile path')
|
|
144
|
-
.option('--image-name [image-name]', 'Set image name')
|
|
145
|
-
.option('--image-path [image-path]', 'Set tar image path')
|
|
146
|
-
.option('--dockerfile-name [dockerfile-name]', 'set Dockerfile name')
|
|
147
|
-
.option('--podman-save', 'Export tar file from podman')
|
|
148
|
-
.option('--kind-load', 'Import tar image to Kind cluster')
|
|
149
|
-
.option('--secrets', 'Dockerfile env secrets')
|
|
150
|
-
.option('--secrets-path [secrets-path]', 'Dockerfile custom path env secrets')
|
|
151
|
-
.option('--no-cache', 'Build without using cache')
|
|
152
|
-
.description('Build image from Dockerfile')
|
|
153
|
-
.action(Underpost.image.dockerfile.build);
|
|
154
|
-
|
|
155
|
-
program
|
|
156
|
-
.command('dockerfile-pull-base-images')
|
|
157
|
-
.description('Pull underpost dockerfile images requirements')
|
|
158
|
-
.action(Underpost.image.dockerfile.pullBaseImages);
|
|
159
|
-
|
|
160
|
-
program
|
|
161
|
-
.command('install')
|
|
162
|
-
.description('Fast import underpost npm dependencies')
|
|
163
|
-
.action(() => {
|
|
164
|
-
fs.copySync(`${underpostRootPath}/node_modules`, './node_modules');
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
program
|
|
168
|
-
.command('db')
|
|
169
|
-
.argument('<deploy-list>', 'Deploy id list, e.g. default-a,default-b')
|
|
170
|
-
.option('--import', 'Import container backups from repositories')
|
|
171
|
-
.option('--export', 'Export container backups to repositories')
|
|
172
|
-
.option('--pod-name <pod-name>', 'Optional pod context')
|
|
173
|
-
.option('--collections <collections>', 'Comma separated collections')
|
|
174
|
-
.option('--out-path <out-path>', 'Custom out path backup')
|
|
175
|
-
.option('--drop', 'Drop databases')
|
|
176
|
-
.option('--preserveUUID', 'Preserve Ids')
|
|
177
|
-
.option('--git', 'Upload to github')
|
|
178
|
-
.option('--hosts <hosts>', 'Comma separated hosts')
|
|
179
|
-
.option('--paths <paths>', 'Comma separated paths')
|
|
180
|
-
.option('--ns <ns-name>', 'Optional name space context')
|
|
181
|
-
.description('Manage databases')
|
|
182
|
-
.action(Underpost.db.callback);
|
|
183
|
-
|
|
184
|
-
program
|
|
185
|
-
.command('script')
|
|
186
|
-
.argument('operator', `Options: ${Object.keys(Underpost.script)}`)
|
|
187
|
-
.argument('<script-name>', 'Script name')
|
|
188
|
-
.argument('[script-value]', 'Literal command, or path')
|
|
189
|
-
.option('--itc', 'Inside container execution context')
|
|
190
|
-
.option('--itc-path', 'Inside container path options')
|
|
191
|
-
.option('--ns <ns-name>', 'Options name space context')
|
|
192
|
-
.option('--pod-name <pod-name>')
|
|
193
|
-
.description(
|
|
194
|
-
'Supports a number of built-in underpost global scripts and their preset life cycle events as well as arbitrary scripts',
|
|
195
|
-
)
|
|
196
|
-
.action((...args) => Underpost.script[args[0]](args[1], args[2], args[3]));
|
|
197
|
-
|
|
198
|
-
program
|
|
199
|
-
.command('cron')
|
|
200
|
-
.argument('[deploy-list]', 'Deploy id list, e.g. default-a,default-b')
|
|
201
|
-
.argument('[job-list]', `Deploy id list, e.g. ${Object.keys(Underpost.cron)}, for default all available jobs`)
|
|
202
|
-
.option('--itc', 'Inside container execution context')
|
|
203
|
-
.option('--init', 'Init cron jobs for cron job default deploy id')
|
|
204
|
-
.option('--git', 'Upload to github')
|
|
205
|
-
.option('--dashboard-update', 'Update dashboard cron data with current jobs config')
|
|
206
|
-
.description('Cron jobs management')
|
|
207
|
-
.action(Underpost.cron.callback);
|
|
208
|
-
|
|
209
|
-
program
|
|
210
|
-
.command('fs')
|
|
211
|
-
.argument('[path]', 'Absolute or relative directory')
|
|
212
|
-
.option('--rm', 'Remove file')
|
|
213
|
-
.option('--git', 'Current git changes')
|
|
214
|
-
.option('--recursive', 'Upload files recursively')
|
|
215
|
-
.option('--deploy-id <deploy-id>', 'Deploy configuration id')
|
|
216
|
-
.option('--pull', 'Download file')
|
|
217
|
-
.option('--force', 'Force action')
|
|
218
|
-
.description('File storage management, for default upload file')
|
|
219
|
-
.action(Underpost.fs.callback);
|
|
220
|
-
|
|
221
|
-
program
|
|
222
|
-
.command('test')
|
|
223
|
-
.argument('[deploy-list]', 'Deploy id list, e.g. default-a,default-b')
|
|
224
|
-
.description('Manage Test, for default run current underpost default test')
|
|
225
|
-
.option('--itc', 'Inside container execution context')
|
|
226
|
-
.option('--sh', 'Copy to clipboard, container entrypoint shell command')
|
|
227
|
-
.option('--logs', 'Display container logs')
|
|
228
|
-
.option('--pod-name <pod-name>')
|
|
229
|
-
.option('--pod-status <pod-status>')
|
|
230
|
-
.option('--kind-type <kind-type>')
|
|
231
|
-
.action(Underpost.test.callback);
|
|
232
|
-
|
|
233
|
-
program
|
|
234
|
-
.command('monitor')
|
|
235
|
-
.argument('<deploy-id>', 'Deploy configuration id')
|
|
236
|
-
.argument('[env]', 'Optional environment, for default is development')
|
|
237
|
-
.option('--ms-interval <ms-interval>', 'Custom ms interval delta time')
|
|
238
|
-
.option('--now', 'Exec immediately monitor script')
|
|
239
|
-
.option('--single', 'Disable recurrence')
|
|
240
|
-
.option('--type <type>', 'Set custom monitor type')
|
|
241
|
-
.description('Monitor health server management')
|
|
242
|
-
.action(Underpost.monitor.callback);
|
|
3
|
+
import { program } from '../src/cli/index.js';
|
|
243
4
|
|
|
244
5
|
program.parse();
|