简体   繁体   中英

Delete old SonarQube projects with script

I have a lot of unused and old sonarqube projects which I need to delete. With the Sonarqube API (Bulk-delete) I can only delete the projects by ID but I need to delete all projects which are older than 3 months. Is there a way to delete all projects older than 3 months maybe with a script? I can't delete them by hand because there are too many projects. I tried to google my problem but the only script I've found was a python script and I have no idea how to use it.

Thanks!

SonarQube Web API lets you get the last analysis date of projects. All you need to do then is to combine that with your script to delete projects.

Refer to this question for details on which Web API to use for querying the last analysis date .

Note that there's also a UI feature (covering your use-case) coming up in SonarQube 6.x series: SONAR-4566 - Bulk deletion: add a criterion "Last analysis more than X days old"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM