WIP: gitea

This commit is contained in:
2022-11-24 22:10:34 +01:00
parent 0f8db6be08
commit 1a3084e651
9 changed files with 155 additions and 13 deletions

View File

@@ -42,8 +42,7 @@ pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
tracing::debug!(name, "running action");
tracing::info!("fetching repos");
let mut paths = Vec::new();
let mut git_paths = Vec::new();
if let Some(git) = select.git.clone() {
let mut repo_clones = Vec::with_capacity(git.repositories.len());
for repo in git.repositories {
@@ -53,11 +52,27 @@ pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
for repo_clone in repo_clones {
let path = repo_clone.await??;
paths.push(path);
git_paths.push(path);
}
}
for (path, repo) in paths {
let mut gitea_paths = Vec::new();
if let Some(gitea) = &select.gitea {
let mut repo_clones = Vec::with_capacity(gitea.repositories.len());
for repo in gitea.repositories {
let gp = service_register.gitea_provider.clone();
repo_clones.push(tokio::spawn(
async move { gp.clone_from_qualified(repo).await },
))
}
for repo_clone in repo_clones {
let path = repo_clone.await??;
gitea_paths.push(path);
}
}
for (path, repo) in git_paths {
let repo = Arc::new(Mutex::new(repo));
if let Some(git) = select.git.clone() {
if let Some(push) = git.push {