@heronlabs/terminal-cli 2.0.3 → 2.1.0
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 +16 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Scheduled, type-safe database backups with a single binary:
|
|
|
32
32
|
|
|
33
33
|
- **One tool, two engines** — PostgreSQL (`pg_dump`/`psql`) and MySQL (`mysqldump`/`mysql`) behind one CLI.
|
|
34
34
|
- **S3 or local** — push backups to S3 by default, or keep them on disk with `--local` (handy for seeding).
|
|
35
|
-
- **Cron-ready
|
|
35
|
+
- **Cron-ready container** — one image plus `easypanel/` inline-Dockerfile templates run a backup on start and every 12 hours.
|
|
36
36
|
- **100% tested** — v8 coverage + Stryker mutation testing, both at 100% thresholds.
|
|
37
37
|
|
|
38
38
|
## Install
|
|
@@ -172,22 +172,23 @@ src/
|
|
|
172
172
|
|
|
173
173
|
## Docker & Cron
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
One published image — `heronlabs/terminal-cli` (built from `Dockerfile`) — carries
|
|
176
|
+
`hcli` on `PATH`, both DB clients, and busybox `crond`. Scheduled backups are
|
|
177
|
+
deployed from the inline-Dockerfile templates under [`easypanel/`](easypanel/):
|
|
178
|
+
each one is `FROM heronlabs/terminal-cli:<tag>`, adds a 12-hourly crontab, and
|
|
179
|
+
runs an immediate backup before starting `crond` in the foreground (dumping
|
|
180
|
+
`printenv` to `/etc/environment` so cron inherits the runtime variables EasyPanel
|
|
181
|
+
injects). See [`easypanel/README.md`](easypanel/README.md) for deploy steps.
|
|
176
182
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
| `cron-tab-mysql.dockerfile` | MySQL cron container — backup on start + every 12h |
|
|
182
|
-
|
|
183
|
-
The cron images dump `printenv` to `/etc/environment` so `crond` inherits the
|
|
184
|
-
runtime variables injected by EasyPanel, run an immediate backup, then start
|
|
185
|
-
`crond` in the foreground.
|
|
186
|
-
|
|
187
|
-
Local stack for manual testing:
|
|
183
|
+
Local stack for manual testing — `docker-compose.yml` runs the psql + mysql DBs
|
|
184
|
+
(exposed on ports 5434/3307) and the `psql-integration`/`mysql-integration`
|
|
185
|
+
services that run the backup/rollup round-trip inside the prod-shaped
|
|
186
|
+
`integration-{postgres,mysql}.dockerfile` images:
|
|
188
187
|
|
|
189
188
|
```bash
|
|
190
|
-
docker compose up
|
|
189
|
+
docker compose up postgres mysql # local DBs only
|
|
190
|
+
docker compose run --build --rm psql-integration # PostgreSQL round-trip
|
|
191
|
+
docker compose run --build --rm mysql-integration # MySQL round-trip
|
|
191
192
|
```
|
|
192
193
|
|
|
193
194
|
## EasyPanel host backup
|
|
@@ -209,7 +210,7 @@ then fail), so schedule it as root.
|
|
|
209
210
|
|
|
210
211
|
### Scheduling (every 12h)
|
|
211
212
|
|
|
212
|
-
Install the CLI on the host (Ubuntu 22.04) and match the DB
|
|
213
|
+
Install the CLI on the host (Ubuntu 22.04) and match the DB backup templates'
|
|
213
214
|
cadence with a host crontab line:
|
|
214
215
|
|
|
215
216
|
```bash
|
package/package.json
CHANGED
|
@@ -90,11 +90,11 @@
|
|
|
90
90
|
"dep:cruise": "depcruise src --config .dependency-cruiser.json",
|
|
91
91
|
"lint:check": "gts lint && eslint \"**/*.json\" \"**/*.yml\" \"**/*.yaml\" --no-error-on-unmatched-pattern && pnpm lint:shell",
|
|
92
92
|
"lint:fix": "gts fix && eslint \"**/*.json\" \"**/*.yml\" \"**/*.yaml\" --fix --no-error-on-unmatched-pattern && pnpm lint:shell",
|
|
93
|
-
"lint:shell": "find src -name '*.sh' -exec shellcheck {} +",
|
|
93
|
+
"lint:shell": "find src tests/integration -name '*.sh' -exec shellcheck {} +",
|
|
94
94
|
"prepublishOnly": "pnpm build",
|
|
95
95
|
"start": "dotenv -- node bin/src/main.js",
|
|
96
96
|
"test:mutation": "stryker run stryker.conf.json",
|
|
97
97
|
"test:unit": "vitest run"
|
|
98
98
|
},
|
|
99
|
-
"version": "2.0
|
|
99
|
+
"version": "2.1.0"
|
|
100
100
|
}
|