Generate names for pipeline runs.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#![forbid(unsafe_code)]
|
||||
use std::borrow::Borrow;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
@@ -23,6 +24,7 @@ use self::discovery::discover_matching_push_triggers;
|
||||
use self::discovery::discover_webhook_bridge_config;
|
||||
use self::gitea_client::GiteaClient;
|
||||
use self::hook_push::HookPush;
|
||||
use self::hook_push::PipelineParamters;
|
||||
use self::in_repo_config::InRepoConfig;
|
||||
use self::kubernetes::run_pipelines;
|
||||
use self::webhook::hook;
|
||||
@@ -58,11 +60,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let gitea_api_token = std::env::var("WEBHOOK_BRIDGE_OAUTH_TOKEN")?;
|
||||
let gitea = GiteaClient::new(gitea_api_root, gitea_api_token);
|
||||
|
||||
let webhook_payload: HookPush = serde_json::from_str(EXAMPLE_WEBHOOK_PAYLOAD)?;
|
||||
let repo_tree = gitea
|
||||
.get_tree(
|
||||
"talexander",
|
||||
"webhook_bridge",
|
||||
"b8444344c4821e87a894cd195f8bec39cd501f68",
|
||||
webhook_payload.get_pull_base_sha()?,
|
||||
)
|
||||
.await?;
|
||||
let in_repo_config = discover_webhook_bridge_config(&gitea, &repo_tree).await?;
|
||||
@@ -70,8 +73,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
discover_matching_push_triggers(&gitea, &repo_tree, "refs/heads/main", &in_repo_config)
|
||||
.await?;
|
||||
|
||||
let webhook_payload: HookPush = serde_json::from_str(EXAMPLE_WEBHOOK_PAYLOAD)?;
|
||||
|
||||
run_pipelines(webhook_payload, pipelines, kubernetes_client).await?;
|
||||
|
||||
// let app = Router::new()
|
||||
|
||||
Reference in New Issue
Block a user