Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
af821a9d3a
commit
5c205d1ac1
@ -407,14 +407,6 @@ pub async fn base_rust_image(
|
||||
_ => eyre::bail!("architecture not supported"),
|
||||
};
|
||||
let rust_build_image = client
|
||||
// .container_opts(QueryContainerOpts {
|
||||
// id: None,
|
||||
// platform: Some(
|
||||
// platform
|
||||
// .map(|p| Platform(p))
|
||||
// .unwrap_or(client.default_platform().await?),
|
||||
// ),
|
||||
// })
|
||||
.container()
|
||||
.from(
|
||||
args.rust_builder_image
|
||||
@ -465,7 +457,7 @@ pub async fn base_rust_image(
|
||||
)
|
||||
.with_directory(
|
||||
//format!("/mnt/src/target/{}/release/build", rust_target),
|
||||
"target/",
|
||||
"target",
|
||||
//rust_prebuild.id().await?,
|
||||
incremental_dir.id().await?,
|
||||
)
|
||||
|
@ -12,7 +12,7 @@ use cuddle_please_misc::{
|
||||
VcsClient,
|
||||
};
|
||||
use tracing::Level;
|
||||
use tracing_subscriber::{EnvFilter};
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
||||
use crate::{
|
||||
config_command::{ConfigCommand, ConfigCommandHandler},
|
||||
@ -90,6 +90,35 @@ impl Command {
|
||||
}
|
||||
|
||||
pub fn execute(self, current_dir: Option<&Path>) -> anyhow::Result<()> {
|
||||
match &self.commands {
|
||||
Some(Commands::Release {}) => {
|
||||
let (config, git_client, gitea_client) = self.get_deps(current_dir)?;
|
||||
ReleaseCommandHandler::new(self.ui, config, git_client, gitea_client)
|
||||
.execute(self.global.dry_run)?;
|
||||
}
|
||||
Some(Commands::Config { command }) => {
|
||||
let (config, _, _) = self.get_deps(current_dir)?;
|
||||
ConfigCommandHandler::new(self.ui, config).execute(command)?;
|
||||
}
|
||||
Some(Commands::Gitea { command }) => {
|
||||
let (config, _, gitea_client) = self.get_deps(current_dir)?;
|
||||
|
||||
GiteaCommandHandler::new(self.ui, config, gitea_client)
|
||||
.execute(command, self.global.token.expect("token to be set").deref())?;
|
||||
}
|
||||
Some(Commands::Doctor {}) => {
|
||||
DoctorCommandHandler::new(self.ui).execute()?;
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_deps(
|
||||
&self,
|
||||
current_dir: Option<&Path>,
|
||||
) -> anyhow::Result<(PleaseConfig, VcsClient, DynRemoteGitClient)> {
|
||||
let config = self.build_config(current_dir)?;
|
||||
let git_client = self.get_git(&config)?;
|
||||
let gitea_client = self.get_gitea_client(&config);
|
||||
@ -110,25 +139,7 @@ impl Command {
|
||||
tracing_subscriber::fmt().with_env_filter(env_filter).init();
|
||||
}
|
||||
|
||||
match &self.commands {
|
||||
Some(Commands::Release {}) => {
|
||||
ReleaseCommandHandler::new(self.ui, config, git_client, gitea_client)
|
||||
.execute(self.global.dry_run)?;
|
||||
}
|
||||
Some(Commands::Config { command }) => {
|
||||
ConfigCommandHandler::new(self.ui, config).execute(command)?;
|
||||
}
|
||||
Some(Commands::Gitea { command }) => {
|
||||
GiteaCommandHandler::new(self.ui, config, gitea_client)
|
||||
.execute(command, self.global.token.expect("token to be set").deref())?;
|
||||
}
|
||||
Some(Commands::Doctor {}) => {
|
||||
DoctorCommandHandler::new(self.ui).execute()?;
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
return Ok((config, git_client, gitea_client));
|
||||
}
|
||||
|
||||
fn build_config(&self, current_dir: Option<&Path>) -> Result<PleaseConfig, anyhow::Error> {
|
||||
|
Loading…
Reference in New Issue
Block a user