mirror of
https://github.com/moghtech/komodo.git
synced 2026-04-29 04:10:01 -05:00
Stack: login to registry BEFORE pulling image
This commit is contained in:
@@ -122,22 +122,6 @@ pub async fn compose_up(
|
||||
let last_project_name = stack.project_name(false);
|
||||
let project_name = stack.project_name(true);
|
||||
|
||||
// Pull images before destroying to minimize downtime.
|
||||
// If this fails, do not continue.
|
||||
let log = run_monitor_command(
|
||||
"compose pull",
|
||||
format!(
|
||||
"cd {run_dir} && {docker_compose} -p {project_name} -f {file_args} pull{service_arg}",
|
||||
),
|
||||
)
|
||||
.await;
|
||||
if !log.success {
|
||||
res.logs.push(log);
|
||||
return Err(anyhow!(
|
||||
"Failed to pull required images, stopping the run."
|
||||
));
|
||||
}
|
||||
|
||||
// Login to the registry to pull private images, if account is set
|
||||
if !stack.config.registry_account.is_empty() {
|
||||
let registry = ImageRegistry::Standard(StandardRegistryConfig {
|
||||
@@ -157,6 +141,22 @@ pub async fn compose_up(
|
||||
.context("failed to login to image registry")?;
|
||||
}
|
||||
|
||||
// Pull images before destroying to minimize downtime.
|
||||
// If this fails, do not continue.
|
||||
let log = run_monitor_command(
|
||||
"compose pull",
|
||||
format!(
|
||||
"cd {run_dir} && {docker_compose} -p {project_name} -f {file_args} pull{service_arg}",
|
||||
),
|
||||
)
|
||||
.await;
|
||||
if !log.success {
|
||||
res.logs.push(log);
|
||||
return Err(anyhow!(
|
||||
"Failed to pull required images, stopping the run."
|
||||
));
|
||||
}
|
||||
|
||||
// Take down the existing containers.
|
||||
// This one tries to use the previously deployed service name, to ensure the right stack is taken down.
|
||||
destroy_existing_containers(&last_project_name, service, res)
|
||||
|
||||
Reference in New Issue
Block a user