pyvolt-cli 0.4.0__tar.gz → 0.5.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyvolt-cli
3
- Version: 0.4.0
3
+ Version: 0.5.1
4
4
  Summary: The command-line companion to Pyvolt: managed Python deployments on infrastructure you actually own.
5
5
  Project-URL: Homepage, https://pyvolt.com
6
6
  Project-URL: Repository, https://github.com/pyvolt-hq/pyvolt-cli
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pyvolt-cli"
7
- version = "0.4.0"
7
+ version = "0.5.1"
8
8
  description = "The command-line companion to Pyvolt: managed Python deployments on infrastructure you actually own."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -343,11 +343,38 @@ def deploy(
343
343
 
344
344
 
345
345
  @app.command()
346
- def deployments(app_name: str = typer.Argument(..., metavar="DOMAIN")):
346
+ def deployments(
347
+ app_name: str = typer.Argument(..., metavar="DOMAIN"),
348
+ watch: bool = typer.Option(
349
+ False, "--watch", "-w",
350
+ help="Wait for the next deployment (e.g. after a git push), stream its log, "
351
+ "exit non-zero on failure. Attaches if one is already running.",
352
+ ),
353
+ ):
347
354
  """Recent deployments for an app."""
348
355
  api = Api()
349
356
  site = api.resolve_app(app_name)
350
357
  data = api.get(f"/v1/apps/{site['id']}/deployments")
358
+ if watch:
359
+ running = next((d for d in data if d["status"] in ("queued", "running")), None)
360
+ if running is None:
361
+ baseline = data[0]["id"] if data else None
362
+ console.print(f"[dim]Waiting for the next deployment of {site['domain']}… (^C to stop)[/dim]")
363
+ while running is None:
364
+ time.sleep(3)
365
+ latest = api.get(f"/v1/apps/{site['id']}/deployments", params={"limit": 1})
366
+ if latest and latest[0]["id"] != baseline:
367
+ running = latest[0]
368
+ msg = ((running.get("commit_message") or "").splitlines() or [""])[0][:60]
369
+ console.print(
370
+ f"[green]▶[/green] Deployment [bold]{running['commit_sha'][:7]}[/bold] {msg} "
371
+ f"({running.get('triggered_by', '')})"
372
+ )
373
+ status = _follow(api, running["id"])
374
+ if status == "failed":
375
+ raise fail("Deployment failed.")
376
+ console.print(f"\n[green]✓[/green] Deployed {site['domain']}")
377
+ return
351
378
  if _emit(data):
352
379
  return
353
380
  t = _table("WHEN", "STATUS", "COMMIT", "MESSAGE", "BY", "TOOK")
File without changes
File without changes
File without changes