From 283b4cd2f434823d355b4a311b5b8bc2788f3654 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 30 Mar 2024 14:23:52 +0100 Subject: [PATCH] feat: update templater Signed-off-by: kjuulh --- crates/drone-templater/src/main.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/drone-templater/src/main.rs b/crates/drone-templater/src/main.rs index b81bc6f..78fb65d 100644 --- a/crates/drone-templater/src/main.rs +++ b/crates/drone-templater/src/main.rs @@ -67,6 +67,24 @@ async fn main() -> anyhow::Result<()> { ); let client = reqwest::Client::new(); + + match client + .delete(&template_url) + .bearer_auth(&drone_token) + .send() + .await + { + Ok(res) => match res.error_for_status() { + Ok(_) => {} + Err(status) => { + tracing::warn!("failed to delete template {}", status); + } + }, + Err(e) => { + tracing::error!("{}", e); + } + } + let res = client .put(&template_url) .bearer_auth(&drone_token)