Skip to content

Commit 97876c6

Browse files
author
underpostnet
committed
ci(package-pwa-microservices-template-ghpkg): ⚙️ Update github repo package
1 parent f9ba3d9 commit 97876c6

File tree

18 files changed

+378
-119
lines changed

18 files changed

+378
-119
lines changed

.vscode/extensions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@
1010
"github.codespaces",
1111
"github.vscode-github-actions",
1212
"golang.go",
13-
"google.geminicodeassist",
1413
"gruntfuggly.todo-tree",
1514
"mechatroner.rainbow-csv",
1615
"mindaro-dev.file-downloader",
17-
"mindaro.mindaro",
1816
"ms-azuretools.vscode-containers",
1917
"ms-azuretools.vscode-docker",
2018
"ms-kubernetes-tools.vscode-kubernetes-tools",
2119
"ms-python.black-formatter",
2220
"ms-python.debugpy",
2321
"ms-python.python",
2422
"ms-python.vscode-pylance",
23+
"ms-vscode-remote.remote-containers",
2524
"oderwat.indent-rainbow",
2625
"pleiades.java-extension-pack-jdk",
2726
"ravioshankar.scala-gurus",

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Run dev client server
6868
npm run dev
6969
```
7070
<!-- -->
71-
## underpost ci/cd cli v2.8.799
71+
## underpost ci/cd cli v2.8.8
7272

7373
### Usage: `underpost [options] [command]`
7474
```
@@ -84,7 +84,7 @@ Commands:
8484
cmt [options] <path> <commit-type> [module-tag] [message] Commit github repository
8585
push [options] <path> <uri> Push github repository
8686
env <deploy-id> [env] Set environment variables files and conf related to <deploy-id>
87-
config <operator> [key] [value] Manage configuration, operators
87+
config [options] <operator> [key] [value] Manage configuration, operators
8888
root Get npm root path
8989
cluster [options] [pod-name] Manage cluster, for default initialization base kind cluster
9090
deploy [options] [deploy-list] [env] Manage deployment, for default deploy development pods
@@ -99,6 +99,7 @@ Commands:
9999
test [options] [deploy-list] Manage Test, for default run current underpost default test
100100
monitor [options] <deploy-id> [env] Monitor health server management
101101
lxd [options] Lxd management
102+
baremetal [options] Baremetal management
102103
help [command] display help for command
103104
104105
```

bin/deploy.js

Lines changed: 61 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
setUpProxyMaintenanceServer,
2828
writeEnv,
2929
getUnderpostRootPath,
30+
buildCliDoc,
3031
} from '../src/server/conf.js';
3132
import { buildClient } from '../src/server/client-build.js';
3233
import { range, s4, setPad, timer, uniqueArray } from '../src/client/components/core/CommonJs.js';
@@ -37,10 +38,10 @@ import { JSONweb } from '../src/server/client-formatted.js';
3738

3839
import { Xampp } from '../src/runtime/xampp/Xampp.js';
3940
import { ejs } from '../src/server/json-schema.js';
40-
import { buildCliDoc } from '../src/cli/index.js';
4141
import { getLocalIPv4Address, ip } from '../src/server/dns.js';
4242
import { Downloader } from '../src/server/downloader.js';
4343
import colors from 'colors';
44+
import { program } from '../src/cli/index.js';
4445

4546
colors.enable();
4647

@@ -1158,7 +1159,7 @@ EOF`);
11581159
}
11591160

11601161
case 'cli-docs': {
1161-
buildCliDoc();
1162+
buildCliDoc(program);
11621163
break;
11631164
}
11641165

@@ -1211,6 +1212,18 @@ EOF`);
12111212
}
12121213

12131214
case 'postgresql-14': {
1215+
if (process.argv.includes('install')) {
1216+
shellExec(`sudo dnf module reset postgresql -y`);
1217+
shellExec(`sudo dnf -qy module disable postgresql`);
1218+
1219+
shellExec(`sudo systemctl stop postgresql-14`);
1220+
shellExec(`sudo systemctl disable postgresql-14`);
1221+
1222+
shellExec(`sudo dnf remove -y postgresql14 postgresql14-server postgresql14-contrib`);
1223+
shellExec(`sudo rm -rf /var/lib/pgsql`);
1224+
1225+
shellExec(`sudo dnf install postgresql14 postgresql14-server postgresql14-contrib -y`);
1226+
}
12141227
shellExec(`sudo /usr/pgsql-14/bin/postgresql-14-setup initdb`);
12151228
shellExec(`sudo systemctl start postgresql-14`);
12161229
shellExec(`sudo systemctl enable postgresql-14`);
@@ -1260,41 +1273,13 @@ EOF`);
12601273
const netmask = process.env.NETMASK;
12611274
const gatewayip = process.env.GATEWAY_IP;
12621275

1263-
let resources;
1264-
try {
1265-
resources = JSON.parse(
1266-
shellExec(`maas ${process.env.MAAS_ADMIN_USERNAME} boot-resources read`, {
1267-
silent: true,
1268-
stdout: true,
1269-
}),
1270-
).map((o) => ({
1271-
id: o.id,
1272-
name: o.name,
1273-
architecture: o.architecture,
1274-
}));
1275-
} catch (error) {
1276-
logger.error(error);
1277-
}
1278-
12791276
const machineFactory = (m) => ({
12801277
system_id: m.interface_set[0].system_id,
12811278
mac_address: m.interface_set[0].mac_address,
12821279
hostname: m.hostname,
12831280
status_name: m.status_name,
12841281
});
12851282

1286-
let machines;
1287-
try {
1288-
machines = JSON.parse(
1289-
shellExec(`maas ${process.env.MAAS_ADMIN_USERNAME} machines read`, {
1290-
stdout: true,
1291-
silent: true,
1292-
}),
1293-
).map((m) => machineFactory(m));
1294-
} catch (error) {
1295-
logger.error(error);
1296-
}
1297-
12981283
if (process.argv.includes('db')) {
12991284
// DROP, ALTER, CREATE, WITH ENCRYPTED
13001285
// sudo -u <user> -h <host> psql <db-name>
@@ -1315,6 +1300,7 @@ EOF`);
13151300
shellExec(`sudo -i -u postgres createdb -O "$DB_PG_MAAS_USER" "$DB_PG_MAAS_NAME"`);
13161301

13171302
shellExec(`sudo -i -u postgres psql -c "\\l"`);
1303+
process.exit(0);
13181304
}
13191305

13201306
if (process.argv.includes('ls')) {
@@ -1399,6 +1385,23 @@ EOF`);
13991385

14001386
process.exit(0);
14011387
}
1388+
1389+
if (process.argv.includes('restart')) {
1390+
shellExec(`sudo snap restart maas.pebble`);
1391+
let secs = 0;
1392+
while (
1393+
!(
1394+
shellExec(`maas status`, { silent: true, disableLog: true, stdout: true })
1395+
.split(' ')
1396+
.filter((l) => l.match('inactive')).length === 1
1397+
)
1398+
) {
1399+
await timer(1000);
1400+
console.log(`Waiting... (${++secs}s)`);
1401+
}
1402+
process.exit(0);
1403+
}
1404+
14021405
// shellExec(`MAAS_ADMIN_USERNAME=${process.env.MAAS_ADMIN_USERNAME}`);
14031406
// shellExec(`MAAS_ADMIN_EMAIL=${process.env.MAAS_ADMIN_EMAIL}`);
14041407
// shellExec(`maas createadmin --username $MAAS_ADMIN_USERNAME --email $MAAS_ADMIN_EMAIL`);
@@ -1491,6 +1494,34 @@ EOF`);
14911494
// ip link show
14921495
// nmcli con show
14931496

1497+
let resources;
1498+
try {
1499+
resources = JSON.parse(
1500+
shellExec(`maas ${process.env.MAAS_ADMIN_USERNAME} boot-resources read`, {
1501+
silent: true,
1502+
stdout: true,
1503+
}),
1504+
).map((o) => ({
1505+
id: o.id,
1506+
name: o.name,
1507+
architecture: o.architecture,
1508+
}));
1509+
} catch (error) {
1510+
logger.error(error);
1511+
}
1512+
1513+
let machines;
1514+
try {
1515+
machines = JSON.parse(
1516+
shellExec(`maas ${process.env.MAAS_ADMIN_USERNAME} machines read`, {
1517+
stdout: true,
1518+
silent: true,
1519+
}),
1520+
).map((m) => machineFactory(m));
1521+
} catch (error) {
1522+
logger.error(error);
1523+
}
1524+
14941525
let firmwarePath,
14951526
tftpSubDir,
14961527
kernelFilesPaths,
@@ -1635,21 +1666,6 @@ BOOT_ORDER=0x21`;
16351666

16361667
shellExec(`node bin/deploy nfs`);
16371668

1638-
if (process.argv.includes('restart')) {
1639-
shellExec(`sudo snap restart maas.pebble`);
1640-
let secs = 0;
1641-
while (
1642-
!(
1643-
shellExec(`maas status`, { silent: true, disableLog: true, stdout: true })
1644-
.split(' ')
1645-
.filter((l) => l.match('inactive')).length === 1
1646-
)
1647-
) {
1648-
await timer(1000);
1649-
console.log(`Waiting... (${++secs}s)`);
1650-
}
1651-
}
1652-
16531669
switch (process.argv[3]) {
16541670
case 'rpi4mb':
16551671
{

cli.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## underpost ci/cd cli v2.8.799
1+
## underpost ci/cd cli v2.8.8
22

33
### Usage: `underpost [options] [command]`
44
```
@@ -14,7 +14,7 @@ Commands:
1414
cmt [options] <path> <commit-type> [module-tag] [message] Commit github repository
1515
push [options] <path> <uri> Push github repository
1616
env <deploy-id> [env] Set environment variables files and conf related to <deploy-id>
17-
config <operator> [key] [value] Manage configuration, operators
17+
config [options] <operator> [key] [value] Manage configuration, operators
1818
root Get npm root path
1919
cluster [options] [pod-name] Manage cluster, for default initialization base kind cluster
2020
deploy [options] [deploy-list] [env] Manage deployment, for default deploy development pods
@@ -29,6 +29,7 @@ Commands:
2929
test [options] [deploy-list] Manage Test, for default run current underpost default test
3030
monitor [options] <deploy-id> [env] Monitor health server management
3131
lxd [options] Lxd management
32+
baremetal [options] Baremetal management
3233
help [command] display help for command
3334
3435
```
@@ -171,6 +172,7 @@ Arguments:
171172
value Config value
172173
173174
Options:
175+
--plain Print plain value
174176
-h, --help display help for command
175177
176178
```
@@ -506,4 +508,23 @@ Options:
506508
-h, --help display help for command
507509
508510
```
511+
512+
513+
### `baremetal` :
514+
```
515+
Usage: underpost baremetal [options]
516+
517+
Baremetal management
518+
519+
Options:
520+
--control-server-install Install baremetal control server
521+
--control-server-init-db Setup database baremetal control server
522+
--control-server-init Init baremetal control server
523+
--control-server-uninstall Uninstall baremetal control server
524+
--control-server-stop Stop baremetal control server
525+
--control-server-start Start baremetal control server
526+
--dev Set dev context env
527+
-h, --help display help for command
528+
529+
```
509530

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ services:
5858
cpus: '0.25'
5959
memory: 20M
6060
labels: # labels in Compose file instead of Dockerfile
61-
engine.version: '2.8.799'
61+
engine.version: '2.8.8'
6262
networks:
6363
- load-balancer
6464

manifests/deployment/dd-template-development/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
spec:
1818
containers:
1919
- name: dd-template-development-blue
20-
image: localhost/debian-underpost:v2.8.799
20+
image: localhost/debian-underpost:v2.8.8
2121
# resources:
2222
# requests:
2323
# memory: "124Ki"
@@ -100,7 +100,7 @@ spec:
100100
spec:
101101
containers:
102102
- name: dd-template-development-green
103-
image: localhost/debian-underpost:v2.8.799
103+
image: localhost/debian-underpost:v2.8.8
104104
# resources:
105105
# requests:
106106
# memory: "124Ki"

manifests/maas/lxd-preseed.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
config:
2+
core.https_address: "[::]:8443"
3+
# core.trust_password: password
4+
networks:
5+
- config:
6+
ipv4.address: 10.10.10.1/24
7+
ipv6.address: none
8+
description: ""
9+
name: lxdbr0
10+
type: ""
11+
project: default
12+
storage_pools:
13+
- config:
14+
size: 500GB
15+
description: ""
16+
name: default
17+
driver: zfs
18+
profiles:
19+
- config: {}
20+
description: ""
21+
devices:
22+
eth0:
23+
name: eth0
24+
network: lxdbr0
25+
type: nic
26+
root:
27+
path: /
28+
pool: default
29+
type: disk
30+
name: default
31+
projects: []
32+
cluster: null

0 commit comments

Comments
 (0)