[FOLIO-2249] Tenant clean up script Created: 10/Sep/19 Updated: 03/Jun/20 Resolved: 22/Sep/19 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Task | Priority: | P2 |
| Reporter: | John Malconian | Assignee: | Ian Hardy |
| Resolution: | Done | Votes: | 0 |
| Labels: | platform-backlog | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Issue links: |
|
||||||||||||||||
| Sprint: | CP: sprint 72 | ||||||||||||||||
| Story Points: | 3 | ||||||||||||||||
| Development Team: | Core: Platform | ||||||||||||||||
| Description |
|
A script is required to clean up FOLIO CI tenants and S3 buckets created by pull requests. If a PR is in a closed state the tenant and all tenant data should be removed and the S3 bucket should be deleted. |
| Comments |
| Comment by Ian Hardy [ 10/Sep/19 ] |
|
| Comment by John Malconian [ 10/Sep/19 ] |
|
Each S3 bucket has a tag with the a key of 'Pr' and a value of <PLATFORM>-PR-NUMBER that can be used to associate the bucket with the PR. So, for example, the value of the tag on the S3 bucket used for platform-core PR-383 would be 'platform-core-383' |
| Comment by Ian Hardy [ 13/Sep/19 ] |
|
John Malconian Any reason to search across regions for these buckets, or can I assume they'll all be in the same one? |
| Comment by John Malconian [ 16/Sep/19 ] |
|
Ian Hardy All buckets will be created in the us-east-1 region. |
| Comment by Ian Hardy [ 22/Sep/19 ] |
|
Deployed tenant cleanup script in container, tested by closing: https://github.com/folio-org/platform-core/pull/382 Cleans up aws bucket + all tenants associated w/PR (several tenants are possible if pr was updated). output from cleanup job: Checking pr for tenant: platform_core_382_10 delete tenant function sucessfully deleted platform_core_382_10 platform-core-382 could not find bucket platform-core-382 Checking pr for tenant: platform_core_382_11 delete tenant function sucessfully deleted platform_core_382_11 platform-core-382 could not find bucket platform-core-382 Checking pr for tenant: platform_core_382_12 delete tenant function sucessfully deleted platform_core_382_12 platform-core-382 could not find bucket platform-core-382 Checking pr for tenant: platform_core_382_13 delete tenant function sucessfully deleted platform_core_382_13 platform-core-382 could not find bucket platform-core-382 Checking pr for tenant: platform_core_382_14 delete tenant function sucessfully deleted platform_core_382_14 platform-core-382 could not find bucket platform-core-382 Checking pr for tenant: platform_core_382_15 delete tenant function sucessfully deleted platform_core_382_15 platform-core-382 could not find bucket platform-core-382 Checking pr for tenant: platform_core_382_16 delete tenant function sucessfully deleted platform_core_382_16 platform-core-382 could not find bucket platform-core-382 Checking pr for tenant: platform_core_382_6 delete tenant function sucessfully deleted platform_core_382_6 platform-core-382 could not find bucket platform-core-382 |