Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
e5b3e1b62a
commit
663feba85d
@ -341,28 +341,36 @@ impl MainAction for RustService {
|
||||
|
||||
let update_deployments_docker_image =
|
||||
"docker.io/kasperhermansen/update-deployment:1690401410";
|
||||
self.client
|
||||
let dep = self
|
||||
.client
|
||||
.container()
|
||||
.from(update_deployments_docker_image)
|
||||
.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),
|
||||
])
|
||||
.sync()
|
||||
.await?;
|
||||
.from(update_deployments_docker_image);
|
||||
|
||||
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")
|
||||
} 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![
|
||||
"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?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user