Add Makefile for running CI jobs locally.

This commit is contained in:
Tom Alexander
2024-09-28 22:32:20 -04:00
parent efe37f020a
commit c20927b726
9 changed files with 85 additions and 69 deletions

View File

@@ -25,8 +25,8 @@ 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::remote_config::RemoteConfig;
use self::webhook::hook;
use self::webhook::verify_signature;
use kube::CustomResourceExt;
@@ -35,8 +35,8 @@ mod crd_pipeline_run;
mod discovery;
mod gitea_client;
mod hook_push;
mod in_repo_config;
mod kubernetes;
mod remote_config;
mod webhook;
const EXAMPLE_WEBHOOK_PAYLOAD: &'static str = include_str!("../example_webhook_payload.json");
@@ -68,9 +68,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
webhook_payload.get_pull_base_sha()?,
)
.await?;
let in_repo_config = discover_webhook_bridge_config(&gitea, &repo_tree).await?;
let remote_config = discover_webhook_bridge_config(&gitea, &repo_tree).await?;
let pipelines =
discover_matching_push_triggers(&gitea, &repo_tree, "refs/heads/main", &in_repo_config)
discover_matching_push_triggers(&gitea, &repo_tree, "refs/heads/main", &remote_config)
.await?;
run_pipelines(webhook_payload, pipelines, kubernetes_client).await?;