Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get corresponding build artifacts of a job in jenkins ?

I create Jenkins jobs using hudson.cli.CLI jar. I have selected "Archive the artifacts" option in the "Post-build steps" section. It archives the artifacts on each succesfull build. I am using jenkins remote access api http://localhost:8080/job/job_name/api/json to get details about jobs. and http://localhost:8080/job/job_name/job_number/api/json to get details about builds.

When I delete a build corresponding archived artifacts are not deleted. I'd like to make sure that they are deleted.

When I use jenkins remote access api http://localhost:8080/job/[job_name]/[job_number]/api/json for a build, it returns json data which contains all previously archived artifacts (other successful builds artifacts) with this (running build) build artifact. How do I get related artifact of a build (a successful build should return its artifact, not all previous successfull artifacts). Any suggestions or ideas ?

like image 872
Muthu Avatar asked Feb 24 '12 13:02

Muthu


People also ask

Where does Jenkins save all the setting build artifacts and logs?

$JENKINS_HOME is where all Jenkins-based installations store configuration, build logs, and artifacts.


1 Answers

I suspect that you do not clean your workspace between the builds and archive all the artifacts that are found there, including those from previous builds.

like image 73
malenkiy_scot Avatar answered Oct 11 '22 07:10

malenkiy_scot