pub struct DeploymentService;Expand description
Deployment service for managing remote deployments
§Examples
ⓘ
use mecha10_cli::services::{DeploymentService, DeployConfig, DeployStrategy};
use std::path::Path;
let service = DeploymentService::new();
// Configure deployment
let mut config = DeployConfig::default();
config.host = "192.168.1.100".to_string();
config.user = "robot".to_string();
// Test connection
service.test_connection(&config)?;
// Deploy package
let result = service.deploy(
&config,
Path::new("target/packages/my-robot-1.0.0.tar.gz"),
DeployStrategy::Direct
).await?;
println!("Deployment: {}", result.message);Implementations§
Source§impl DeploymentService
impl DeploymentService
Sourcepub fn test_connection(&self, config: &DeployConfig) -> Result<()>
pub fn test_connection(&self, config: &DeployConfig) -> Result<()>
Sourcepub fn create_backup(&self, config: &DeployConfig) -> Result<()>
pub fn create_backup(&self, config: &DeployConfig) -> Result<()>
Sourcepub fn upload_package(
&self,
config: &DeployConfig,
package_path: &Path,
) -> Result<()>
pub fn upload_package( &self, config: &DeployConfig, package_path: &Path, ) -> Result<()>
Upload package to remote system
§Arguments
config- Deployment configurationpackage_path- Local path to package file
Sourcepub async fn deploy(
&self,
config: &DeployConfig,
package_path: &Path,
strategy: DeployStrategy,
) -> Result<DeployResult>
pub async fn deploy( &self, config: &DeployConfig, package_path: &Path, strategy: DeployStrategy, ) -> Result<DeployResult>
Deploy package using specified strategy
§Arguments
config- Deployment configurationpackage_path- Local path to package filestrategy- Deployment strategy to use
Sourcepub async fn health_check(&self, config: &DeployConfig) -> Result<bool>
pub async fn health_check(&self, config: &DeployConfig) -> Result<bool>
Sourcepub async fn rollback(&self, config: &DeployConfig) -> Result<()>
pub async fn rollback(&self, config: &DeployConfig) -> Result<()>
Sourcepub fn run_remote_command(
&self,
config: &DeployConfig,
command: &str,
) -> Result<String>
pub fn run_remote_command( &self, config: &DeployConfig, command: &str, ) -> Result<String>
Run command on remote system via SSH
§Arguments
config- Deployment configurationcommand- Command to execute
Sourcepub fn get_service_status(&self, config: &DeployConfig) -> Result<String>
pub fn get_service_status(&self, config: &DeployConfig) -> Result<String>
Sourcepub fn list_backups(&self, config: &DeployConfig) -> Result<Vec<String>>
pub fn list_backups(&self, config: &DeployConfig) -> Result<Vec<String>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeploymentService
impl RefUnwindSafe for DeploymentService
impl Send for DeploymentService
impl Sync for DeploymentService
impl Unpin for DeploymentService
impl UnwindSafe for DeploymentService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more