Add a pipeline to build the server image.
This commit is contained in:
@@ -9,7 +9,7 @@ use serde_json::Value;
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub(crate) struct HookPush {
|
||||
#[serde(rename = "ref")]
|
||||
ref_field: String,
|
||||
pub(crate) ref_field: String,
|
||||
before: String,
|
||||
after: String,
|
||||
compare_url: String,
|
||||
|
||||
12
src/main.rs
12
src/main.rs
@@ -39,7 +39,7 @@ mod kubernetes;
|
||||
mod remote_config;
|
||||
mod webhook;
|
||||
|
||||
const EXAMPLE_WEBHOOK_PAYLOAD: &'static str = include_str!("../example_webhook_payload.json");
|
||||
const EXAMPLE_WEBHOOK_PAYLOAD: &'static str = include_str!("../example_tag_webhook_payload.json");
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
@@ -69,9 +69,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
)
|
||||
.await?;
|
||||
let remote_config = discover_webhook_bridge_config(&gitea, &repo_tree).await?;
|
||||
let pipelines =
|
||||
discover_matching_push_triggers(&gitea, &repo_tree, "refs/heads/main", &remote_config)
|
||||
.await?;
|
||||
let pipelines = discover_matching_push_triggers(
|
||||
&gitea,
|
||||
&repo_tree,
|
||||
&webhook_payload.ref_field,
|
||||
&remote_config,
|
||||
)
|
||||
.await?;
|
||||
|
||||
run_pipelines(webhook_payload, pipelines, kubernetes_client).await?;
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ impl RemoteConfig {
|
||||
.iter()
|
||||
.map(|s| Regex::new(s.as_str()))
|
||||
.collect::<Result<_, _>>()?;
|
||||
if !push.branches.is_empty() && match_regex.iter().any(|r| r.is_match(branch)) {
|
||||
if !push.branches.is_empty() && !match_regex.iter().any(|r| r.is_match(branch)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user