underpost 2.8.787 → 2.8.788
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/README.md +1 -1
- package/cli.md +2 -1
- package/docker-compose.yml +1 -1
- package/package.json +1 -1
- package/src/cli/index.js +1 -0
- package/src/cli/lxd.js +7 -1
- package/src/index.js +1 -1
package/README.md
CHANGED
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.8.
|
|
1
|
+
## underpost ci/cd cli v2.8.788
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -482,6 +482,7 @@ Options:
|
|
|
482
482
|
--create-virtual-network Create lxd virtual network bridge
|
|
483
483
|
--create-admin-profile Create admin profile for lxd management
|
|
484
484
|
--control set control node vm context
|
|
485
|
+
--worker set worker node context
|
|
485
486
|
--create-vm <vm-id> Create default virtual machines
|
|
486
487
|
--init-vm <vm-id> Get init vm underpost script
|
|
487
488
|
--info-vm <vm-id> Get all info vm
|
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
package/src/cli/index.js
CHANGED
|
@@ -279,6 +279,7 @@ program
|
|
|
279
279
|
.option('--create-virtual-network', 'Create lxd virtual network bridge')
|
|
280
280
|
.option('--create-admin-profile', 'Create admin profile for lxd management')
|
|
281
281
|
.option('--control', 'set control node vm context')
|
|
282
|
+
.option('--worker', 'set worker node context')
|
|
282
283
|
.option('--create-vm <vm-id>', 'Create default virtual machines')
|
|
283
284
|
.option('--init-vm <vm-id>', 'Get init vm underpost script')
|
|
284
285
|
.option('--info-vm <vm-id>', 'Get all info vm')
|
package/src/cli/lxd.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { getNpmRootPath } from '../server/conf.js';
|
|
2
|
+
import { getLocalIPv4Address } from '../server/dns.js';
|
|
2
3
|
import { pbcopy, shellExec } from '../server/process.js';
|
|
4
|
+
import fs from 'fs-extra';
|
|
3
5
|
|
|
4
6
|
class UnderpostLxd {
|
|
5
7
|
static API = {
|
|
@@ -28,7 +30,11 @@ class UnderpostLxd {
|
|
|
28
30
|
if (options.init === true) {
|
|
29
31
|
shellExec(`sudo systemctl start snap.lxd.daemon`);
|
|
30
32
|
shellExec(`sudo systemctl status snap.lxd.daemon`);
|
|
31
|
-
|
|
33
|
+
const lxdPressedContent = fs
|
|
34
|
+
.readFileSync(`${underpostRoot}/manifests/lxd/lxd-preseed.yaml`, 'utf8')
|
|
35
|
+
.replaceAll(`127.0.0.1`, getLocalIPv4Address());
|
|
36
|
+
// shellExec(`lxd init --preseed < ${underpostRoot}/manifests/lxd/lxd-preseed.yaml`);
|
|
37
|
+
shellExec(`echo "${lxdPressedContent}" | lxd init --preseed`);
|
|
32
38
|
shellExec(`lxc cluster list`);
|
|
33
39
|
}
|
|
34
40
|
if (options.createVirtualNetwork === true) {
|