use crate::common::PathConfigArgs;
use clap::Args;
use std::path::PathBuf;
#[derive(Args)]
pub struct DeployArgs {
#[command(flatten)]
path_config: PathConfigArgs,
#[arg(short = 't', long, value_name = "TAG")]
tag: Option<String>,
#[arg(short = 'm', long, value_name = "Cargo.toml")]
manifest: Option<PathBuf>,
#[arg(long)]
debug: bool,
#[arg(long)]
dockerfile: Option<PathBuf>,
#[arg(long = "args", value_name = "KEY=VALUE")]
args: Vec<cargo_gears_core::deploy::DockerBuildArg>,
}
impl DeployArgs {
pub fn run(self) -> anyhow::Result<()> {
cargo_gears_core::deploy::DeployParams::from(self).run()
}
}
impl From<DeployArgs> for cargo_gears_core::deploy::DeployParams {
fn from(args: DeployArgs) -> Self {
Self {
path_config: args.path_config.into(),
tag: args.tag,
manifest: args.manifest,
debug: args.debug,
dockerfile: args.dockerfile,
args: args.args,
}
}
}