wattetheria 0.1.7 → 0.1.9
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 +8 -1
- package/lib/cli.js +43 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -564,8 +564,14 @@ Version commands:
|
|
|
564
564
|
- `npx wattetheria --version` shows the current Wattetheria release version
|
|
565
565
|
- `npx wattetheria version --images` prints the configured image refs for the current deployment
|
|
566
566
|
- `npx wattetheria version --cli` shows the deployment CLI package version
|
|
567
|
-
- `npx wattetheria update` resolves the latest shared published image tag across the configured release images and upgrades to it
|
|
567
|
+
- `npx wattetheria update` refreshes the local deployment compose asset, resolves the latest shared published image tag across the configured release images, and upgrades to it
|
|
568
568
|
- `npx wattetheria update --tag <tag>` pins the deployment to a specific published image tag
|
|
569
|
+
- `npx wattetheria restart` stops and recreates the local release stack from the current deployment config
|
|
570
|
+
|
|
571
|
+
Publisher command:
|
|
572
|
+
|
|
573
|
+
- `RELEASE=<tag> scripts/publish-ghcr.sh` verifies the release compose/env assets before pushing the
|
|
574
|
+
multi-architecture Wattetheria kernel and observatory images to GHCR
|
|
569
575
|
|
|
570
576
|
Release deployments bind-mount host-visible state by default:
|
|
571
577
|
|
|
@@ -597,6 +603,7 @@ pwsh ./scripts/deploy-release.ps1
|
|
|
597
603
|
- `docker-compose.release.yml` is the image-based release deployment asset used by the CLI and fallback scripts
|
|
598
604
|
- the CLI now generates deployment environment defaults internally and resolves the latest published image release during install and update
|
|
599
605
|
- `scripts/deploy-release.ps1` is a cross-platform fallback deployment entry point
|
|
606
|
+
- `scripts/verify-release-deployment.sh` is the release gate that checks the packaged compose file still wires gateway URLs and the Wattswarm startup config into `wattetheria-kernel`
|
|
600
607
|
- this repository does not include `wattetheria-gateway`; gateway is a separate project and deployment unit
|
|
601
608
|
- Entrypoints live in `scripts/docker-kernel-entrypoint.sh` and `scripts/docker-observatory-entrypoint.sh`
|
|
602
609
|
- release process and compatibility rules are documented in `docs/dev/RELEASE_PUBLISH_CHECKLIST.md`
|
package/lib/cli.js
CHANGED
|
@@ -92,6 +92,7 @@ Commands:
|
|
|
92
92
|
start Start an existing deployment
|
|
93
93
|
status Show docker compose status
|
|
94
94
|
update Resolve latest published release, pull, and restart
|
|
95
|
+
restart Recreate and restart the deployment
|
|
95
96
|
stop Stop the deployment
|
|
96
97
|
uninstall Stop the deployment and optionally remove volumes
|
|
97
98
|
logs Show docker compose logs
|
|
@@ -674,6 +675,29 @@ async function ensureDockerAvailable(options = {}) {
|
|
|
674
675
|
}
|
|
675
676
|
}
|
|
676
677
|
|
|
678
|
+
function refreshDeploymentComposeAsset(templatePath, targetPath, options) {
|
|
679
|
+
if (!fs.existsSync(targetPath)) {
|
|
680
|
+
fs.copyFileSync(templatePath, targetPath);
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
const template = fs.readFileSync(templatePath, "utf8");
|
|
685
|
+
const current = fs.readFileSync(targetPath, "utf8");
|
|
686
|
+
if (!options.force && current === template) {
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
if (current !== template) {
|
|
691
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
692
|
+
const backupPath = `${targetPath}.bak-${timestamp}`;
|
|
693
|
+
fs.copyFileSync(targetPath, backupPath);
|
|
694
|
+
console.log(`Backed up previous deployment compose: ${backupPath}`);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
fs.copyFileSync(templatePath, targetPath);
|
|
698
|
+
console.log("Refreshed deployment compose from current CLI package.");
|
|
699
|
+
}
|
|
700
|
+
|
|
677
701
|
function ensureDeploymentAssets(options) {
|
|
678
702
|
fs.mkdirSync(options.dir, { recursive: true });
|
|
679
703
|
|
|
@@ -686,9 +710,7 @@ function ensureDeploymentAssets(options) {
|
|
|
686
710
|
} else {
|
|
687
711
|
mergeNewDefaultKeys(targetEnvPath);
|
|
688
712
|
}
|
|
689
|
-
|
|
690
|
-
fs.copyFileSync(templateComposePath, targetComposePath);
|
|
691
|
-
}
|
|
713
|
+
refreshDeploymentComposeAsset(templateComposePath, targetComposePath, options);
|
|
692
714
|
|
|
693
715
|
const envMap = readEnvFile(targetEnvPath);
|
|
694
716
|
envMap.set("WATTETHERIA_RUNTIME_ENV_FILE", path.basename(targetEnvPath));
|
|
@@ -1001,6 +1023,21 @@ async function start(options) {
|
|
|
1001
1023
|
printSummary(options);
|
|
1002
1024
|
}
|
|
1003
1025
|
|
|
1026
|
+
async function restart(options) {
|
|
1027
|
+
await ensureDockerAvailable();
|
|
1028
|
+
if (!fs.existsSync(composeFilePath(options)) || !fs.existsSync(envFilePath(options))) {
|
|
1029
|
+
throw new Error("Deployment is not initialized. Run install first.");
|
|
1030
|
+
}
|
|
1031
|
+
console.log("Stopping release stack...");
|
|
1032
|
+
runCompose(options, ["down"]);
|
|
1033
|
+
console.log("Starting release stack...");
|
|
1034
|
+
runCompose(options, ["up", "-d"]);
|
|
1035
|
+
if (options.healthChecks) {
|
|
1036
|
+
await runHealthChecks(options);
|
|
1037
|
+
}
|
|
1038
|
+
printSummary(options);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1004
1041
|
async function status(options) {
|
|
1005
1042
|
await ensureDockerAvailable();
|
|
1006
1043
|
runCompose(options, ["ps"]);
|
|
@@ -1210,6 +1247,9 @@ async function run(argv) {
|
|
|
1210
1247
|
case "update":
|
|
1211
1248
|
await update(options);
|
|
1212
1249
|
return;
|
|
1250
|
+
case "restart":
|
|
1251
|
+
await restart(options);
|
|
1252
|
+
return;
|
|
1213
1253
|
case "stop":
|
|
1214
1254
|
case "down":
|
|
1215
1255
|
await stop(options);
|