feat: add deployment take 2
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-01-28 20:45:25 +01:00
parent 3da154882d
commit c0ae03376b
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912

View File

@ -5,7 +5,7 @@ use crate::{cuddle_file::CuddleFile, MainAction};
pub struct CuddleReleaser { pub struct CuddleReleaser {
client: dagger_sdk::Query, client: dagger_sdk::Query,
env: String, env: Option<String>,
cuddle_file: CuddleFile, cuddle_file: CuddleFile,
folder: String, folder: String,
@ -22,7 +22,7 @@ impl CuddleReleaser {
pub async fn new(client: dagger_sdk::Query) -> eyre::Result<Self> { pub async fn new(client: dagger_sdk::Query) -> eyre::Result<Self> {
let cuddle_file = CuddleFile::from_cuddle_file().await?; let cuddle_file = CuddleFile::from_cuddle_file().await?;
let env = std::env::var("CUDDLE_ENV").context("CUDDLE_ENV was not set")?; let env = std::env::var("CUDDLE_ENV").ok();
Ok(Self { Ok(Self {
client, client,
@ -49,7 +49,7 @@ impl MainAction for CuddleReleaser {
.unwrap() .unwrap()
.env .env
.0 .0
.get(&self.env.to_string()) .get(&self.env.as_ref().unwrap_or(&"prod".to_string()).to_string())
{ {
Some(c) => match c.clusters.first().take() { Some(c) => match c.clusters.first().take() {
Some(c) => c, Some(c) => c,