buildhudsonjenkinscommand-line-interface

How to delete an archived artifact in jenkins?


  1. I am using Jenkins with tomcat. I use jenkins cli from java class to create job and to build. I want to delete a archived artifact. How to accomplish this?

  2. Another question is, can we give a specific name to the build in jenkins (e.g) i want the build name like (buildNumber + someName). How to achieve this?


Solution

  • The artifacts for a build by default are located in: [JENKINS_HOME]/jobs/[job_name]/builds/[$BUILD_ID]/archive/, go there and delete it. It won't delete the link to the artifact from the build page, though. (If you are not sure where your JENKINS_HOME is, go to http://[jenkins_server]/configure, you'll see Home directory near the top of the page).

    To change the display name of a build automatically try Build Name Setter Plugin.

    To change the display name via CLI:

    java -jar jenkins-cli.jar -s http://[server]/ set-build-display-name [job_name] [build#] [new_name]