koigrid 0.3.0 → 0.4.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/CHANGELOG.md +7 -0
- package/dist/commands/apps.js +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the koigrid CLI are documented here. Format: [Keep a Changelog](https://keepachangelog.com). Versions follow [SemVer](https://semver.org).
|
|
4
4
|
|
|
5
|
+
## [0.4.0] — 2026-07-05
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **`--health-path`** on `apps deploy` (e.g. `--health-path /api/health`): koigrid probes that path after each
|
|
9
|
+
deploy. A 5xx / no-response means the container runs but the app is broken (e.g. can't reach its DB) — koigrid
|
|
10
|
+
emits `app.unhealthy` instead of calling it healthy. Closes the "running but broken" blind spot.
|
|
11
|
+
|
|
5
12
|
## [0.3.0] — 2026-07-05
|
|
6
13
|
|
|
7
14
|
### Added
|
package/dist/commands/apps.js
CHANGED
|
@@ -17,13 +17,15 @@ export async function apps(a) {
|
|
|
17
17
|
const name = a.positionals[0], image = a.flags.image, repo = a.flags.repo;
|
|
18
18
|
const dir = a.flags.dir; // deploy desde un directorio LOCAL (código privado, sin git/Docker)
|
|
19
19
|
const repoToken = a.flags['repo-token']; // token/deploy-key para repos privados
|
|
20
|
+
const healthPath = a.flags['health-path']; // ruta de salud (/api/health) → koigrid detecta apps rotas
|
|
21
|
+
const hc = healthPath ? { healthCheckPath: healthPath } : {};
|
|
20
22
|
if (!name || (!image && !repo && !dir))
|
|
21
23
|
throw new Error('usage: koigrid apps deploy <name> --dir <path>|--image <img>|--repo <git-url> [--repo-token <t>] [--port N]');
|
|
22
24
|
const port = a.flags.port ? Number(a.flags.port) : 3000;
|
|
23
25
|
// deploy --dir: empaqueta el directorio (excluye lo pesado/irrelevante) → subida presignada a koigrid →
|
|
24
26
|
// el runner lo construye igual que un repo. No requiere git ni Docker local.
|
|
25
27
|
if (dir) {
|
|
26
|
-
const app = await api('/apps', { method: 'POST', body: { name, port } });
|
|
28
|
+
const app = await api('/apps', { method: 'POST', body: { name, port, ...hc } });
|
|
27
29
|
const aid = app.app?.id || app.id;
|
|
28
30
|
const up = await api(`/apps/${encodeURIComponent(aid)}/source-upload`, { method: 'POST', body: {} });
|
|
29
31
|
const { uploadUrl, archiveKey } = up.upload;
|
|
@@ -35,7 +37,7 @@ export async function apps(a) {
|
|
|
35
37
|
await api(`/apps/${encodeURIComponent(aid)}/deployments`, { method: 'POST', body: { sourceType: 'archive', archiveKey } });
|
|
36
38
|
return json ? console.log(JSON.stringify({ id: aid, status: 'queued', source: 'dir' }, null, 2)) : console.log(green(`✓ Deploying "${name}" from ${dir}…`));
|
|
37
39
|
}
|
|
38
|
-
const app = await api('/apps', { method: 'POST', body: repo ? { name, sourceType: 'git', repo, port, ...(repoToken ? { repoToken } : {}) } : { name, sourceType: 'image', image, port } });
|
|
40
|
+
const app = await api('/apps', { method: 'POST', body: repo ? { name, sourceType: 'git', repo, port, ...(repoToken ? { repoToken } : {}), ...hc } : { name, sourceType: 'image', image, port, ...hc } });
|
|
39
41
|
const aid = app.app?.id || app.id;
|
|
40
42
|
await api(`/apps/${encodeURIComponent(aid)}/deployments`, { method: 'POST', body: {} });
|
|
41
43
|
return json ? console.log(JSON.stringify({ id: aid, status: 'queued' }, null, 2)) : console.log(green(`✓ Deploying "${name}"…`));
|