Skip to main content

systemprompt_cli/commands/cloud/deploy/pipeline/
progress.rs

1//! Progress seam between the deploy pipeline and its presentation layer.
2//!
3//! The orchestrator emits a [`DeployEvent`] at every step boundary;
4//! implementations decide how (or whether) to render. Events carry borrowed
5//! data, so no rendering state lives in the pipeline.
6//!
7//! Copyright (c) systemprompt.io — Business Source License 1.1.
8//! See <https://systemprompt.io> for licensing details.
9
10use std::path::Path;
11
12pub trait DeployProgress: Send + Sync {
13    fn event(&self, event: &DeployEvent<'_>);
14}
15
16#[derive(Debug, Clone, Copy)]
17pub enum DeployEvent<'a> {
18    ArtifactsResolved {
19        tenant_name: &'a str,
20        binary: &'a Path,
21        dockerfile: &'a Path,
22    },
23    RegistryAuthStarted,
24    RegistryAuthFinished,
25    ImageResolved {
26        image: &'a str,
27    },
28    BuildStarted,
29    BuildFinished,
30    PushSkipped,
31    PushStarted,
32    PushFinished,
33    SecretsPhaseStarted,
34    SecretsFileMissing,
35    SecretsSyncStarted,
36    SecretsSynced {
37        count: usize,
38    },
39    VaultBootstrapSynced {
40        count: usize,
41    },
42    CredentialsSyncStarted,
43    CredentialsSynced {
44        count: usize,
45    },
46    ProfilePathConfigured,
47    DeployStarted,
48    Deployed {
49        status: &'a str,
50        app_url: Option<&'a str>,
51    },
52}