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
use std::collections::HashMap;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use super::{StringOrBool, deserialize_string_or_bool_opt};
// ---------------------------------------------------------------------------
// DockerHub description sync
// ---------------------------------------------------------------------------
/// DockerHub description sync configuration.
/// Pushes image descriptions and README content to DockerHub repositories.
#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
#[serde(default)]
pub struct DockerHubConfig {
/// DockerHub username for authentication.
pub username: Option<String>,
/// Environment variable name containing the DockerHub token.
pub secret_name: Option<String>,
/// DockerHub image names to update (e.g. `myorg/myapp`).
pub images: Option<Vec<String>>,
/// Short description for the DockerHub repository (max 100 chars).
pub description: Option<String>,
/// Full description (README) source for the DockerHub repository.
pub full_description: Option<DockerHubFullDescription>,
/// Skip this publisher. Accepts bool or template string.
#[serde(deserialize_with = "deserialize_string_or_bool_opt", default)]
pub skip: Option<StringOrBool>,
}
/// Full description source for DockerHub: either from a URL or a local file.
#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
#[serde(default)]
pub struct DockerHubFullDescription {
/// Fetch full description content from a URL.
pub from_url: Option<DockerHubFromUrl>,
/// Read full description content from a local file.
pub from_file: Option<DockerHubFromFile>,
}
/// Fetch DockerHub full description content from a URL.
#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
#[serde(default)]
pub struct DockerHubFromUrl {
/// URL to fetch the full description from.
pub url: String,
/// Optional HTTP headers for the request.
pub headers: Option<HashMap<String, String>>,
}
/// Read DockerHub full description content from a local file.
#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
#[serde(default)]
pub struct DockerHubFromFile {
/// Path to the file containing the full description.
pub path: String,
}