diff --git a/crates/nao/src/lib.rs b/crates/nao/src/lib.rs index 4aeb876c5d..9b443fe10a 100644 --- a/crates/nao/src/lib.rs +++ b/crates/nao/src/lib.rs @@ -312,9 +312,12 @@ impl Nao { ) -> Result<()> { let mut command = self.rsync_with_nao(true)?; command - .arg("--keep-dirlinks") + .arg("--copy-dirlinks") .arg("--copy-links") .arg("--info=progress2") + .arg("--exclude=.git") + .arg("--exclude=webots") + .arg("--filter=dir-merge,- .gitignore") .arg(format!("{}/", local_directory.as_ref().display())) .arg(format!( "{}:{}/", diff --git a/crates/repository/src/upload.rs b/crates/repository/src/upload.rs index 5fa0ac9d94..04591bd1f8 100644 --- a/crates/repository/src/upload.rs +++ b/crates/repository/src/upload.rs @@ -1,13 +1,7 @@ -use std::{ffi::OsString, path::Path}; +use std::path::Path; -use color_eyre::{ - eyre::{bail, Context}, - Result, -}; -use tokio::{ - fs::{create_dir_all, symlink}, - process::Command, -}; +use color_eyre::{eyre::Context, Result}; +use tokio::fs::{create_dir_all, symlink}; pub async fn populate_upload_directory( upload_directory: impl AsRef, @@ -31,28 +25,9 @@ pub async fn populate_upload_directory( .await .wrap_err("failed to link executable")?; - create_dir_all(upload_directory.join("logs")) + symlink(repository_root, upload_directory.join("source")) .await - .wrap_err("failed to create directory for logs")?; - - let source_file = upload_directory.join("logs/source.tar.gz"); - - let mut archive_command = OsString::from("cd "); - archive_command.push(repository_root); - archive_command.push(" && git ls-files --cached --others --exclude-standard | tar Tczf - "); - archive_command.push(source_file); - - let mut command = Command::new("sh"); - command.arg("-c").arg(archive_command); - - let status = command - .status() - .await - .wrap_err("failed to run archive command")?; - - if !status.success() { - bail!("archive command failed with {status}") - } + .wrap_err("failed to link source directory")?; Ok(()) } diff --git a/tools/pepsi/src/upload.rs b/tools/pepsi/src/upload.rs index 503623e57b..8906f5906e 100644 --- a/tools/pepsi/src/upload.rs +++ b/tools/pepsi/src/upload.rs @@ -65,7 +65,7 @@ async fn upload_with_progress( .get_os_version() .await .wrap_err_with(|| format!("failed to get OS version of {nao_address}"))?; - let expected_os_version = read_os_version(repository_root) + let expected_os_version = read_os_version(&repository_root) .await .wrap_err("failed to get configured OS version")?; if nao_os_version != expected_os_version {