underpost 2.8.783 → 2.8.784

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 CHANGED
@@ -68,7 +68,7 @@ Run dev client server
68
68
  npm run dev
69
69
  ```
70
70
  <!-- -->
71
- ## underpost ci/cd cli v2.8.783
71
+ ## underpost ci/cd cli v2.8.784
72
72
 
73
73
  ### Usage: `underpost [options] [command]`
74
74
  ```
package/cli.md CHANGED
@@ -1,4 +1,4 @@
1
- ## underpost ci/cd cli v2.8.783
1
+ ## underpost ci/cd cli v2.8.784
2
2
 
3
3
  ### Usage: `underpost [options] [command]`
4
4
  ```
@@ -480,6 +480,8 @@ Options:
480
480
  --create-admin-profile Create admin profile for lxd management
481
481
  --create-vm <vm-id> Create default virtual machines
482
482
  --init-vm <vm-id> Get init vm underpost script
483
+ --info-vm <vm-id> Get all info vm
484
+ --root-size <gb-size> Set root size vm
483
485
  -h, --help display help for command
484
486
 
485
487
  ```
@@ -58,7 +58,7 @@ services:
58
58
  cpus: '0.25'
59
59
  memory: 20M
60
60
  labels: # labels in Compose file instead of Dockerfile
61
- engine.version: '2.8.783'
61
+ engine.version: '2.8.784'
62
62
  networks:
63
63
  - load-balancer
64
64
 
@@ -1,3 +1,31 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ # Expand /dev/sda2 partition and resize filesystem automatically
6
+
7
+ # Check if parted is installed
8
+ if ! command -v parted &>/dev/null; then
9
+ echo "parted not found, installing..."
10
+ dnf install -y parted
11
+ fi
12
+
13
+ # Get start sector of /dev/sda2
14
+ START_SECTOR=$(parted /dev/sda -ms unit s print | awk -F: '/^2:/{print $2}' | sed 's/s//')
15
+
16
+ # Resize the partition
17
+ parted /dev/sda ---pretend-input-tty <<EOF
18
+ unit s
19
+ resizepart 2 100%
20
+ Yes
21
+ quit
22
+ EOF
23
+
24
+ # Resize the filesystem
25
+ resize2fs /dev/sda2
26
+
27
+ echo "Disk and filesystem resized successfully."
28
+
1
29
  mkdir -p /home/dd
2
30
  sudo dnf install -y tar
3
31
  sudo dnf install -y bzip2
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "underpost",
5
- "version": "2.8.783",
5
+ "version": "2.8.784",
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",
@@ -113,8 +113,9 @@ class UnderpostCluster {
113
113
  shellExec(
114
114
  `sudo kubeadm init --pod-network-cidr=192.168.0.0/16 --control-plane-endpoint="${os.hostname()}:6443"`,
115
115
  );
116
- shellExec(`sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config`);
117
- shellExec(`sudo chown $(id -u):$(id -g) $HOME/.kube/config**`);
116
+ shellExec(`mkdir -p ~/.kube`);
117
+ shellExec(`sudo -E cp -i /etc/kubernetes/admin.conf ~/.kube/config`);
118
+ shellExec(`sudo -E chown $(id -u):$(id -g) ~/.kube/config`);
118
119
  // https://docs.tigera.io/calico/latest/getting-started/kubernetes/quickstart
119
120
  shellExec(
120
121
  `sudo kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.29.3/manifests/tigera-operator.yaml`,
package/src/cli/index.js CHANGED
@@ -277,6 +277,8 @@ program
277
277
  .option('--create-admin-profile', 'Create admin profile for lxd management')
278
278
  .option('--create-vm <vm-id>', 'Create default virtual machines')
279
279
  .option('--init-vm <vm-id>', 'Get init vm underpost script')
280
+ .option('--info-vm <vm-id>', 'Get all info vm')
281
+ .option('--root-size <gb-size>', 'Set root size vm')
280
282
  .description('Lxd management')
281
283
  .action(UnderpostLxd.API.callback);
282
284
 
package/src/cli/lxd.js CHANGED
@@ -12,6 +12,8 @@ class UnderpostLxd {
12
12
  createVirtualNetwork: false,
13
13
  initVm: false,
14
14
  createVm: '',
15
+ infoVm: '',
16
+ rootSize: '',
15
17
  },
16
18
  ) {
17
19
  const npmRoot = getNpmRootPath();
@@ -41,12 +43,22 @@ ipv6.address=none`);
41
43
  }
42
44
  if (options.createVm && typeof options.createVm === 'string') {
43
45
  pbcopy(
44
- `lxc launch images:rockylinux/9 ${options.createVm} --vm --target lxd-node1 -c limits.cpu=2 -c limits.memory=4GB --profile admin-profile`,
46
+ `lxc launch images:rockylinux/9 ${
47
+ options.createVm
48
+ } --vm --target lxd-node1 -c limits.cpu=2 -c limits.memory=4GB --profile admin-profile -d root,size=${
49
+ options.rootSize && typeof options.rootSize === 'string' ? options.rootSize + 'GiB' : '32GiB'
50
+ }`,
45
51
  );
46
52
  }
47
53
  if (options.initVm && typeof options.initVm === 'string') {
48
54
  pbcopy(`cat ${underpostRoot}/manifests/lxd/underpost-setup.sh | lxc exec ${options.initVm} -- bash`);
49
55
  }
56
+ if (options.infoVm && typeof options.infoVm === 'string') {
57
+ shellExec(`lxc config show ${options.infoVm}`);
58
+ shellExec(`lxc info --show-log ${options.infoVm}`);
59
+ shellExec(`lxc info ${options.infoVm}`);
60
+ shellExec(`lxc list ${options.infoVm}`);
61
+ }
50
62
  },
51
63
  };
52
64
  }
package/src/index.js CHANGED
@@ -31,7 +31,7 @@ class Underpost {
31
31
  * @type {String}
32
32
  * @memberof Underpost
33
33
  */
34
- static version = 'v2.8.783';
34
+ static version = 'v2.8.784';
35
35
  /**
36
36
  * Repository cli API
37
37
  * @static