Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically delete old built archives in xcode continuous integration?

I'm using a bot to integrate/build my project with xcode continuous integration. With Jenkins, I can define the max number of builds I want to keep.

Is there a possibility to achieve this with xcode ci with an automated process?

Thank you

like image 889
Georges Avatar asked Feb 02 '14 12:02

Georges


People also ask

Can I delete project Archives in Xcode?

It's safe to delete the folder com. apple. dt. Xcode because Xcode can recreate its caches (it could take some time at first relaunch, if Xcode need to re-download something).

Where do Xcode Archives go?

Xcode created your archive. The actual . xcarchive folder resides on your Mac in ~/Library/Developer/Xcode/Archives.

What is create bot in Xcode?

Bots are processes that Xcode Server runs to perform integrations on the current version of a project in a source code repository. An integration is a single run of a bot. Integrations consist of building, analyzing, testing, and archiving the apps (or other software products) defined in your Xcode projects.

How do I archive a build in Xcode?

Navigate to your project's settings. Under iOS (or the target you want to build your app for) > Identity, you'll want to increment the Build number. For example, if the Build number was 1, you'll want to set it to 2. Then, in the top menu, under Product, click on Archive.


1 Answers

The only useable solutions I found so far is using the REST api of the Xcode server.

Basically you write a script to get all the IDs of the old integrations (using the filter API) and then delete them. Trigger the script from a cron job or jenkins.

https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/XcodeServerAPIReference/Integrations.html#//apple_ref/doc/uid/TP40016472-CH3-SW2

Alternative:

Delete all the old integrations from your Xcode server in the file system under /Library/Developer/XcodeServer/IntegrationAssets/

https://honzadvorsky.com/articles/2015-05-04-under-the-hood-of-xcode-server/

If anyone come up with a easier solutions: I'm all ears.

like image 166
SKerkewitz Avatar answered Sep 17 '22 08:09

SKerkewitz