summaryrefslogtreecommitdiffstats
path: root/src/commands
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-09-09 08:38:59 +0200
committerMatthias Beyer <matthias.beyer@atos.net>2021-09-09 08:38:59 +0200
commit7fa55210e54e49e419d9e0bcff3ca7f144aac597 (patch)
treea6d7eb2430461ebf23832828cbdb9a2f059f896f /src/commands
parent9f021c020ada7403bec2a0dbff0f1b052b916b70 (diff)
parented9d61a07ac69b9bdaf649356622e2553d0ef72c (diff)
Merge branch 'rewrite-find-artifact'
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/find_artifact.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/commands/find_artifact.rs b/src/commands/find_artifact.rs
index 0fc9b8c..6904cf4 100644
--- a/src/commands/find_artifact.rs
+++ b/src/commands/find_artifact.rs
@@ -31,6 +31,7 @@ use crate::filestore::path::StoreRoot;
use crate::package::PackageVersionConstraint;
use crate::repository::Repository;
use crate::util::progress::ProgressBars;
+use crate::util::docker::ImageName;
/// Implementation of the "find_artifact" subcommand
pub async fn find_artifact(matches: &ArgMatches, config: &Configuration, progressbars: ProgressBars, repo: Repository, database_connection: PgConnection) -> Result<()> {
@@ -50,6 +51,10 @@ pub async fn find_artifact(matches: &ArgMatches, config: &Configuration, progres
.transpose()?
.unwrap_or_default();
+ let image_name = matches.value_of("image")
+ .map(String::from)
+ .map(ImageName::from);
+
log::debug!("Finding artifacts for '{:?}' '{:?}'", package_name_regex, package_version_constraint);
let release_stores = config
@@ -102,7 +107,17 @@ pub async fn find_artifact(matches: &ArgMatches, config: &Configuration, progres
.inspect(|pkg| trace!("Found package: {:?}", pkg))
.map(|pkg| {
let script_filter = !matches.is_present("no_script_filter");
- let pathes = crate::db::find_artifacts(database.clone(), config, pkg, &release_stores, staging_store.as_ref(), &env_filter, script_filter)?;
+ let pathes = crate::db::FindArtifacts::builder()
+ .config(config)
+ .release_stores(&release_stores)
+ .staging_store(staging_store.as_ref())
+ .database_connection(database.clone())
+ .env_filter(&env_filter)
+ .script_filter(script_filter)
+ .image_name(image_name.as_ref())
+ .package(pkg)
+ .build()
+ .run()?;
pathes.iter()
.map(|tpl| (tpl.0.joined(), tpl.1))