...
Build expiry can be managed using new support in BCLI. The new setExpiryOptions action available with Version 9.3 or higher. The following assumes you have configured your Bamboo site or at least your build configuration to run the acli CLI script.
- Determine your expiry management criteria in days for each type of data - artifacts, logs, and results (removing a build result also removes artifacts and logs).
- Create a build that runs on your own schedule and includes the follow script
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#!/bin/bash -x acli ${bamboo.localSite} -a run --continue \ -i "-a setExpiryOptions --field artifacts --field expireAfter=2 --field buildsToKeep=5 --field maximumBuildsToKeep=5 --field deploymentsToKeep=5 --field labelsToKeep=keep " \ -i "-a runBuildExpiry" \ -i "-a setExpiryOptions --field logs --field expireAfter=60 --field buildsToKeep=5 --field deploymentsToKeep=5 --field labelsToKeep=keep " \ -i "-a runBuildExpiry" \ -i "-a setExpiryOptions --field results --field expireAfter=120 --field buildsToKeep=5 --field deploymentsToKeep=5 --field labelsToKeep=keep " \ -i "-a runBuildExpiry" |
Tip |
---|
Configure a global bamboo variable to reference the local Bamboo instance site configuration in your acli configuration properties file that provides authentication. |
Tip |
---|
View your current global expiry settings to help you determine the last (results) setting. |
...