(
&self,
environment: &EnvironmentRequest,
infra_ctx: &InfrastructureContext,
)
| 58 | |
| 59 | impl Infrastructure for EnvironmentRequest { |
| 60 | fn build_environment( |
| 61 | &self, |
| 62 | environment: &EnvironmentRequest, |
| 63 | infra_ctx: &InfrastructureContext, |
| 64 | ) -> (Environment, Result<(), Box<EngineError>>) { |
| 65 | let mut env = environment |
| 66 | .to_environment_domain( |
| 67 | infra_ctx.context(), |
| 68 | infra_ctx.cloud_provider(), |
| 69 | infra_ctx.container_registry(), |
| 70 | infra_ctx.kubernetes(), |
| 71 | ) |
| 72 | .unwrap(); |
| 73 | |
| 74 | let deployment_option = DeploymentOption { |
| 75 | force_build: true, |
| 76 | force_push: true, |
| 77 | }; |
| 78 | let logger = Arc::new(infra_ctx.kubernetes().logger().clone_dyn()); |
| 79 | let services_to_build: Vec<&mut dyn Service> = env |
| 80 | .applications |
| 81 | .iter_mut() |
| 82 | .map(|app| app.as_service_mut()) |
| 83 | .chain(env.jobs.iter_mut().map(|job| job.as_service_mut())) |
| 84 | .collect(); |
| 85 | |
| 86 | let ret = EnvironmentTask::build_and_push_services( |
| 87 | environment.long_id, |
| 88 | environment.project_long_id, |
| 89 | services_to_build, |
| 90 | &deployment_option, |
| 91 | infra_ctx, |
| 92 | 1, |
| 93 | |srv: &dyn Service| EnvLogger::new(srv, EnvironmentStep::Build, logger.clone()), |
| 94 | &|| AbortStatus::None, |
| 95 | ); |
| 96 | |
| 97 | (env, ret) |
| 98 | } |
| 99 | |
| 100 | fn deploy_environment( |
| 101 | &self, |
no test coverage detected