mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
37 lines
932 B
Rust
37 lines
932 B
Rust
use super::*;
|
|
use crate::util::Invoke;
|
|
|
|
const V0_2_8: emver::Version = emver::Version::new(0, 2, 8, 0);
|
|
|
|
pub struct Version;
|
|
#[async_trait]
|
|
impl VersionT for Version {
|
|
type Previous = v0_2_7::Version;
|
|
fn new() -> Self {
|
|
Version
|
|
}
|
|
fn semver(&self) -> &'static emver::Version {
|
|
&V0_2_8
|
|
}
|
|
async fn up(&self) -> Result<(), Error> {
|
|
for (app_id, _) in crate::apps::list_info().await? {
|
|
tokio::process::Command::new("docker")
|
|
.arg("stop")
|
|
.arg(&app_id)
|
|
.invoke("Docker")
|
|
.await?;
|
|
tokio::process::Command::new("docker")
|
|
.arg("update")
|
|
.arg("--restart")
|
|
.arg("no")
|
|
.arg(&app_id)
|
|
.invoke("Docker")
|
|
.await?;
|
|
}
|
|
Ok(())
|
|
}
|
|
async fn down(&self) -> Result<(), Error> {
|
|
Ok(())
|
|
}
|
|
}
|