From a6d83daf4d3af6a30ffe8529f18acf1e995741ec Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 30 Mar 2024 01:47:57 +0100 Subject: [PATCH] feat: with aborting Signed-off-by: kjuulh --- crates/cuddle-ci/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/cuddle-ci/src/lib.rs b/crates/cuddle-ci/src/lib.rs index 8d81b37..d847095 100644 --- a/crates/cuddle-ci/src/lib.rs +++ b/crates/cuddle-ci/src/lib.rs @@ -17,6 +17,7 @@ pub mod drone_templater { const DRONE_TEMPLATER_IMAGE: &str = "kasperhermansen/drone-templater:main-1711758171"; use async_trait::async_trait; + use eyre::Context; use crate::MainAction; @@ -39,9 +40,9 @@ pub mod drone_templater { async fn execute_main(&self, _ctx: &mut crate::Context) -> eyre::Result<()> { let src = self.client.host().directory(".cuddle/tmp/"); - let drone_host = std::env::var("DRONE_HOST"); - let drone_user = std::env::var("DRONE_USER"); - let drone_token = std::env::var("DRONE_TOKEN"); + let drone_host = std::env::var("DRONE_HOST").context("DRONE_HOST is missing")?; + let drone_user = std::env::var("DRONE_USER").context("DRONE_USER is missing")?; + let drone_token = std::env::var("DRONE_TOKEN").context("DRONE_TOKEN is missing")?; let drone_token_secret = client.set_secret("DRONE_TOKEN", drone_token);