Open elazarl opened 2 years ago
It is currently possible with the API to get a list of the artifacts of the job. It is even possible to get the URL of the specific artifact:
fn main() -> Result<(), Box<dyn Error>> { let user = "elazarl"; let token = "d4bf510c5963520355749a7da277182aaa"; let jenkins = JenkinsBuilder::new("http://localhost:8000/") .with_user(user, Some(token)) .build().unwrap(); let build = jenkins.get_build("End2EndReport", 2590)?; println!("curl --user {}:{} {}artifact/{}", user, token, build.url, build.artifacts[0].relative_path); Ok(()) }
However I couldn't find a way to use Jenkins to download it:
Jenkins
Path
Is there a way to download a generic artifact?
Something like
impl Jenkins { pub fn get_artifact(build: Build, artifact: Artifact) -> Box<dyn std::io::Read> { let query = self .client .get(&format!("{}artifact/{}", &build.url, artifact.relative_path)); Ok(Self::error_for_status(self.send(query)?)?) }
Does that make sense? Is there any other way to achieve that?
It is currently possible with the API to get a list of the artifacts of the job. It is even possible to get the URL of the specific artifact:
However I couldn't find a way to use
Jenkins
to download it:Path
from jenkins, seems to convert it to json, hence disabling download of logs.Is there a way to download a generic artifact?
Something like
Does that make sense? Is there any other way to achieve that?