Skip to content

Commit be6aa98

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

File tree

10 files changed

+55
-10
lines changed

10 files changed

+55
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
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.783
71+
## underpost ci/cd cli v2.8.784
7272

7373
### Usage: `underpost [options] [command]`
7474
```

cli.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## underpost ci/cd cli v2.8.783
1+
## underpost ci/cd cli v2.8.784
22

33
### Usage: `underpost [options] [command]`
44
```
@@ -480,6 +480,8 @@ Options:
480480
--create-admin-profile Create admin profile for lxd management
481481
--create-vm <vm-id> Create default virtual machines
482482
--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
483485
-h, --help display help for command
484486
485487
```

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.783'
61+
engine.version: '2.8.784'
6262
networks:
6363
- load-balancer
6464

manifests/lxd/underpost-setup.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
129
mkdir -p /home/dd
230
sudo dnf install -y tar
331
sudo dnf install -y bzip2

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "module",
33
"main": "src/index.js",
44
"name": "@underpostnet/underpost",
5-
"version": "2.8.783",
5+
"version": "2.8.784",
66
"description": "pwa api rest template",
77
"scripts": {
88
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",

src/cli/cluster.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ class UnderpostCluster {
113113
shellExec(
114114
`sudo kubeadm init --pod-network-cidr=192.168.0.0/16 --control-plane-endpoint="${os.hostname()}:6443"`,
115115
);
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`);
118119
// https://docs.tigera.io/calico/latest/getting-started/kubernetes/quickstart
119120
shellExec(
120121
`sudo kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.29.3/manifests/tigera-operator.yaml`,

src/cli/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ program
277277
.option('--create-admin-profile', 'Create admin profile for lxd management')
278278
.option('--create-vm <vm-id>', 'Create default virtual machines')
279279
.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')
280282
.description('Lxd management')
281283
.action(UnderpostLxd.API.callback);
282284

src/cli/lxd.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class UnderpostLxd {
1212
createVirtualNetwork: false,
1313
initVm: false,
1414
createVm: '',
15+
infoVm: '',
16+
rootSize: '',
1517
},
1618
) {
1719
const npmRoot = getNpmRootPath();
@@ -41,12 +43,22 @@ ipv6.address=none`);
4143
}
4244
if (options.createVm && typeof options.createVm === 'string') {
4345
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+
}`,
4551
);
4652
}
4753
if (options.initVm && typeof options.initVm === 'string') {
4854
pbcopy(`cat ${underpostRoot}/manifests/lxd/underpost-setup.sh | lxc exec ${options.initVm} -- bash`);
4955
}
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+
}
5062
},
5163
};
5264
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Underpost {
3131
* @type {String}
3232
* @memberof Underpost
3333
*/
34-
static version = 'v2.8.783';
34+
static version = 'v2.8.784';
3535
/**
3636
* Repository cli API
3737
* @static

0 commit comments

Comments
 (0)