feat: update with ssh
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 2023-11-27 22:32:27 +01:00
parent 9c3f806a80
commit 12b7c27342
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912

View File

@ -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,15 +349,25 @@ 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"),
)
};
dep.with_exec(vec![
.with_exec(vec![
"update-deployment",
"--repo",
&format!(
@ -369,8 +379,9 @@ impl MainAction for RustService {
"--image",
&format!("kasperhermansen/{}:main-{}", self.bin_name, timestamp),
])
.sync()
.await?;
};
dep.sync().await?;
Ok(())
}