Only push once every iteration
This commit is contained in:
parent
835545c658
commit
7334ec3708
50
src/lib.rs
50
src/lib.rs
@ -415,35 +415,39 @@ impl BenchmarkRepository
|
|||||||
Err(error) => panic!("could not write commit: {}", error),
|
Err(error) => panic!("could not write commit: {}", error),
|
||||||
};
|
};
|
||||||
|
|
||||||
let push_refspec = format!("refs/remotes/origin/results:refs/heads/results");
|
trace!("created commit “{}”", commit_id);
|
||||||
|
|
||||||
trace!("created commit “{}”, using refspec “{}”", commit_id, push_refspec);
|
|
||||||
|
|
||||||
let mut remote_callbacks = RemoteCallbacks::new();
|
|
||||||
remote_callbacks.credentials(
|
|
||||||
|_, _, _|
|
|
||||||
{
|
|
||||||
match Cred::ssh_key_from_agent(&self.ssh_user)
|
|
||||||
{
|
|
||||||
Ok(value) => Ok(value),
|
|
||||||
Err(error) => panic!("could not retrieve key pair for SSH authentication as user “{}”: {}", self.ssh_user, error),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
remote_callbacks.push_update_reference(
|
|
||||||
|reference, status| BenchmarkRepository::push_update_reference_callback(reference, status));
|
|
||||||
|
|
||||||
let mut push_options = PushOptions::new();
|
|
||||||
push_options.remote_callbacks(remote_callbacks);
|
|
||||||
|
|
||||||
let mut remote = self.repository.find_remote("origin").expect("");
|
|
||||||
remote.push(&[&push_refspec], Some(&mut push_options)).expect("couldn’t push");
|
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if changed
|
||||||
|
{
|
||||||
|
let push_refspec = format!("refs/remotes/origin/results:refs/heads/results");
|
||||||
|
trace!("using push refspec “{}”", push_refspec);
|
||||||
|
|
||||||
|
let mut remote_callbacks = RemoteCallbacks::new();
|
||||||
|
remote_callbacks.credentials(
|
||||||
|
|_, _, _|
|
||||||
|
{
|
||||||
|
match Cred::ssh_key_from_agent(&self.ssh_user)
|
||||||
|
{
|
||||||
|
Ok(value) => Ok(value),
|
||||||
|
Err(error) => panic!("could not retrieve key pair for SSH authentication as user “{}”: {}", self.ssh_user, error),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
remote_callbacks.push_update_reference(
|
||||||
|
|reference, status| BenchmarkRepository::push_update_reference_callback(reference, status));
|
||||||
|
|
||||||
|
let mut push_options = PushOptions::new();
|
||||||
|
push_options.remote_callbacks(remote_callbacks);
|
||||||
|
|
||||||
|
let mut remote = self.repository.find_remote("origin").expect("");
|
||||||
|
remote.push(&[&push_refspec], Some(&mut push_options)).expect("couldn’t push");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("all jobs done, all results uploaded");
|
info!("all jobs done, all results uploaded");
|
||||||
|
Loading…
Reference in New Issue
Block a user