1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use crate::{ContainerOptions, EnvironmentVariables, StepId};
use serde::{Deserialize, Serialize};
use std::time::Duration;

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Secret {
  /// The name of the secret
  pub key: String,
  /// The name of the environment variable to set
  pub env: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Volume {
  /// The name of the volume
  pub key: String,
  /// The path to mount the volume to
  pub path: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Command {
  pub id: StepId,
  pub name: Option<String>,
  pub container: Option<ContainerOptions>,
  pub run: String,
  pub continue_on_error: bool,
  pub environments: EnvironmentVariables,
  pub secrets: Vec<Secret>,
  pub timeout: Duration,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Context {
  pub id: String,
  pub command: Command,
  // cancel signal
}