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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Hanzo Cloud API
*
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RunnerBuildReq {
/// Arch is the target architecture for the artifact lane.
#[serde(rename = "arch", skip_serializing_if = "Option::is_none")]
pub arch: Option<String>,
/// Args are --build-arg values. They are what lets several images off ONE Dockerfile mean different things — the sandbox classes are three entries differing only by STAGE. Validated at the k8s choke point, with VERSION and REVISION taking precedence: those are receipts the builder derives from the tag and the commit, and a caller that could overwrite them could make an image lie about which commit it is.
#[serde(rename = "args", skip_serializing_if = "Option::is_none")]
pub args: Option<std::collections::HashMap<String, String>>,
/// Binaries selects the ARTIFACT lane (artifact.go): build what the repo's hanzo.yml `binaries:` block declares — a Go binary, an npm tarball, a Rust binary — and publish it to hanzoai/s3 instead of pushing an image. It is the same recipe hanzoai/ci reads, sent verbatim, so `image` is meaningless here and must be absent.
#[serde(rename = "binaries", skip_serializing_if = "Option::is_none")]
pub binaries: Option<Vec<models::BinarySpec>>,
/// Branch is the branch to build when no SHA or Ref is given.
#[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
pub branch: Option<String>,
/// Bucket mirrors hanzo.yml's `bucket:` — where the artifact lane publishes.
#[serde(rename = "bucket", skip_serializing_if = "Option::is_none")]
pub bucket: Option<String>,
/// Context is the build context path within the repo.
#[serde(rename = "context", skip_serializing_if = "Option::is_none")]
pub context: Option<String>,
/// DockerTarget is the multi-stage build target to stop at.
#[serde(rename = "dockerTarget", skip_serializing_if = "Option::is_none")]
pub docker_target: Option<String>,
/// Dockerfile is the path to build from; empty uses the zero-config frontend.
#[serde(rename = "dockerfile", skip_serializing_if = "Option::is_none")]
pub dockerfile: Option<String>,
/// Image is the output image ref to push. Required on the image lane, and it must target a registry namespace the caller's org owns.
#[serde(rename = "image", skip_serializing_if = "Option::is_none")]
pub image: Option<String>,
/// OS is the target operating system for the artifact lane.
#[serde(rename = "os", skip_serializing_if = "Option::is_none")]
pub os: Option<String>,
/// Ref is the git ref to build when no SHA is given.
#[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
pub r#ref: Option<String>,
/// Repo is the repository clone URL to build. Required on the image lane.
#[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
pub repo: Option<String>,
/// SHA is the commit to pin; it wins over Ref and Branch.
#[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
pub sha: Option<String>,
/// Tag is the publish path segment, so both entry points write ONE index at ONE URL. It defaults to the pinned ref, and must be named explicitly for a branch.
#[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
pub tag: Option<String>,
}
impl RunnerBuildReq {
pub fn new() -> RunnerBuildReq {
RunnerBuildReq {
arch: None,
args: None,
binaries: None,
branch: None,
bucket: None,
context: None,
docker_target: None,
dockerfile: None,
image: None,
os: None,
r#ref: None,
repo: None,
sha: None,
tag: None,
}
}
}