From 12b7c27342962e9c9510c564c2a0c83b05f2afbc Mon Sep 17 00:00:00 2001 From: kjuulh Date: Mon, 27 Nov 2023 22:32:27 +0100 Subject: [PATCH] feat: update with ssh Signed-off-by: kjuulh --- crates/cuddle-ci/src/rust_service.rs | 41 ++++++++++++++++++---------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/crates/cuddle-ci/src/rust_service.rs b/crates/cuddle-ci/src/rust_service.rs index 99c519a..5e812d8 100644 --- a/crates/cuddle-ci/src/rust_service.rs +++ b/crates/cuddle-ci/src/rust_service.rs @@ -340,7 +340,7 @@ impl MainAction for RustService { .await?; let update_deployments_docker_image = - "docker.io/kasperhermansen/update-deployment:1701119710"; + "docker.io/kasperhermansen/update-deployment:1701120709"; let dep = self .client .container() @@ -349,28 +349,39 @@ impl MainAction for RustService { let dep = if let Some(sock) = std::env::var("SSH_AUTH_SOCK").ok() { dep.with_unix_socket("/tmp/ssh_sock", self.client.host().unix_socket(sock)) .with_env_variable("SSH_AUTH_SOCK", "/tmp/ssh_sock") + .with_exec(vec![ + "update-deployment", + "--repo", + &format!( + "ssh://git@git.front.kjuulh.io/kjuulh/{}-deployment.git", + self.bin_name + ), + "--service", + &self.bin_name, + "--image", + &format!("kasperhermansen/{}:main-{}", self.bin_name, timestamp), + ]) } else { dep.with_env_variable("GIT_USERNAME", "kjuulh") .with_env_variable( "GIT_PASSWORD", std::env::var("GIT_PASSWORD").expect("GIT_PASSWORD to be set"), ) + .with_exec(vec![ + "update-deployment", + "--repo", + &format!( + "https://git.front.kjuulh.io/kjuulh/{}-deployment.git", + self.bin_name + ), + "--service", + &self.bin_name, + "--image", + &format!("kasperhermansen/{}:main-{}", self.bin_name, timestamp), + ]) }; - dep.with_exec(vec![ - "update-deployment", - "--repo", - &format!( - "https://git.front.kjuulh.io/kjuulh/{}-deployment.git", - self.bin_name - ), - "--service", - &self.bin_name, - "--image", - &format!("kasperhermansen/{}:main-{}", self.bin_name, timestamp), - ]) - .sync() - .await?; + dep.sync().await?; Ok(()) }