feat: update leptos service
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -18,6 +18,34 @@ pub struct CuddleReleaserOptions {
|
||||
app: String,
|
||||
}
|
||||
|
||||
pub enum CuddleEnv {
|
||||
Prod,
|
||||
Dev,
|
||||
}
|
||||
|
||||
impl ToString for CuddleEnv {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
CuddleEnv::Prod => "prod".into(),
|
||||
CuddleEnv::Dev => "dev".into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TryInto<CuddleEnv> for String {
|
||||
type Error = eyre::Error;
|
||||
|
||||
fn try_into(self) -> Result<CuddleEnv, Self::Error> {
|
||||
let env = match self.as_str() {
|
||||
"prod" => CuddleEnv::Prod,
|
||||
"dev" => CuddleEnv::Dev,
|
||||
_ => eyre::bail!("was not a valid env: {}", self),
|
||||
};
|
||||
|
||||
Ok(env)
|
||||
}
|
||||
}
|
||||
|
||||
impl CuddleReleaser {
|
||||
pub async fn new(client: dagger_sdk::Query) -> eyre::Result<Self> {
|
||||
let cuddle_file = CuddleFile::from_cuddle_file().await?;
|
||||
@@ -31,11 +59,8 @@ impl CuddleReleaser {
|
||||
folder: ".cuddle/tmp".into(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl MainAction for CuddleReleaser {
|
||||
async fn execute_main(&self, _ctx: &mut cli::Context) -> eyre::Result<()> {
|
||||
pub async fn releaser(&self, env: CuddleEnv) -> eyre::Result<()> {
|
||||
let client = self.client.clone();
|
||||
|
||||
if self.cuddle_file.deployment.is_none() {
|
||||
@@ -49,7 +74,7 @@ impl MainAction for CuddleReleaser {
|
||||
.unwrap()
|
||||
.env
|
||||
.0
|
||||
.get(&self.env.as_ref().unwrap_or(&"prod".to_string()).to_string())
|
||||
.get(&self.env.as_ref().unwrap_or(&env.to_string()).to_string())
|
||||
{
|
||||
Some(c) => match c.clusters.first().take() {
|
||||
Some(c) => c,
|
||||
@@ -111,3 +136,10 @@ impl MainAction for CuddleReleaser {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl MainAction for CuddleReleaser {
|
||||
async fn execute_main(&self, _ctx: &mut cli::Context) -> eyre::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user