add static builder

This commit is contained in:
Thibaud Dauce
2026-02-18 17:23:24 +01:00
parent e60f150611
commit 1561c07432
155 changed files with 161211 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
use clap::{Parser, Subcommand};
use clap::{Parser, Subcommand, ValueEnum};
#[derive(Parser)]
#[command(name = "olla", about = "Couteau suisse local : réseau, domotique, déploiement, et plus.")]
@@ -7,11 +7,35 @@ pub struct Cli {
pub command: Commands,
}
#[derive(Clone, Copy, ValueEnum)]
pub enum Site {
#[value(name = "dev.olla.fr")]
DevOllaFr,
}
impl Site {
pub fn build_dir(&self) -> &'static str {
match self {
Site::DevOllaFr => "build/dev.olla.fr",
}
}
pub fn deploy_target(&self) -> &'static str {
match self {
Site::DevOllaFr => "dev.olla.fr:/var/www/dev.olla.fr/",
}
}
}
#[derive(Subcommand)]
pub enum Commands {
/// Navigation entre les bureaux bspwm
#[command(subcommand)]
Desktop(DesktopCommands),
/// Lancer le mode développement (build + watch + serve)
Dev { site: Site },
/// Déployer un site (build + rsync)
Deploy { site: Site },
}
#[derive(Subcommand)]