Deploy Prowler CIS scanner #310
1 changed files with 19 additions and 25 deletions
Fix container-build-and-release to use single unified workflow
The build-container-nix.yaml workflow was merged into build-container.yaml. Remove the second dispatch that now 404s. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
commit
ed9478f493
|
|
@ -7,10 +7,10 @@
|
|||
#USAGE arg "<container>" help="Container name (directory under containers/)"
|
||||
#USAGE flag "--ref <ref>" help="Commit SHA or branch to build (defaults to current HEAD)"
|
||||
#USAGE flag "--dry-run" help="Show what would be done without triggering"
|
||||
"""Trigger container build workflows via Forgejo API dispatch.
|
||||
"""Trigger container build workflow via Forgejo API dispatch.
|
||||
|
||||
Dispatches both Build Container and Build Container (Nix) workflows.
|
||||
Each workflow checks for its build file and skips if not present.
|
||||
Dispatches the unified build-container workflow, which handles both
|
||||
Dockerfile and Nix builds in a single workflow.
|
||||
"""
|
||||
|
||||
import subprocess
|
||||
|
|
@ -26,10 +26,7 @@ FORGE_API = f"{FORGE_URL}/api/v1"
|
|||
REPO = "eblume/blumeops"
|
||||
FORGE_ACTIONS = f"{FORGE_URL}/{REPO}/actions"
|
||||
|
||||
WORKFLOWS = [
|
||||
"build-container.yaml",
|
||||
"build-container-nix.yaml",
|
||||
]
|
||||
WORKFLOW = "build-container.yaml"
|
||||
|
||||
app = typer.Typer(add_completion=False)
|
||||
|
||||
|
|
@ -108,9 +105,7 @@ def main(
|
|||
typer.echo()
|
||||
|
||||
if dry_run:
|
||||
typer.echo("[dry-run] Would dispatch workflows:")
|
||||
for wf in WORKFLOWS:
|
||||
typer.echo(f" - {wf}")
|
||||
typer.echo(f"[dry-run] Would dispatch {WORKFLOW}")
|
||||
typer.echo()
|
||||
typer.echo(f"Monitor builds at: {FORGE_ACTIONS}")
|
||||
return
|
||||
|
|
@ -121,21 +116,20 @@ def main(
|
|||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
for wf in WORKFLOWS:
|
||||
url = f"{FORGE_API}/repos/{REPO}/actions/workflows/{wf}/dispatches"
|
||||
payload = {
|
||||
"ref": "main",
|
||||
"inputs": {
|
||||
"container": container,
|
||||
"ref": ref,
|
||||
},
|
||||
}
|
||||
resp = httpx.post(url, json=payload, headers=headers, timeout=30)
|
||||
if resp.status_code == 204:
|
||||
typer.echo(f"Dispatched {wf}")
|
||||
else:
|
||||
typer.echo(f"Error dispatching {wf}: {resp.status_code} {resp.text}")
|
||||
raise typer.Exit(1)
|
||||
url = f"{FORGE_API}/repos/{REPO}/actions/workflows/{WORKFLOW}/dispatches"
|
||||
payload = {
|
||||
"ref": "main",
|
||||
"inputs": {
|
||||
"container": container,
|
||||
"ref": ref,
|
||||
},
|
||||
}
|
||||
resp = httpx.post(url, json=payload, headers=headers, timeout=30)
|
||||
if resp.status_code == 204:
|
||||
typer.echo(f"Dispatched {WORKFLOW}")
|
||||
else:
|
||||
typer.echo(f"Error dispatching {WORKFLOW}: {resp.status_code} {resp.text}")
|
||||
raise typer.Exit(1)
|
||||
|
||||
typer.echo()
|
||||
typer.echo(f"Monitor builds at: {FORGE_ACTIONS}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue