added exclude buckets option
All checks were successful
Publish / Publish Docker Container (push) Successful in 2m27s
All checks were successful
Publish / Publish Docker Container (push) Successful in 2m27s
This commit is contained in:
5
main.py
5
main.py
@@ -6,6 +6,7 @@ DEFAULT = ''
|
||||
S3_ENDPOINT = os.getenv('S3_ENDPOINT', DEFAULT)
|
||||
S3_ACCESS_KEY = os.getenv('S3_ACCESS_KEY', DEFAULT)
|
||||
S3_SECRET_KEY = os.getenv('S3_SECRET_KEY', DEFAULT)
|
||||
EXCLUDE_BUCKETS = os.getenv('EXCLUDE_BUCKETS', DEFAULT).split(',')
|
||||
DEFAULT_FILES_TO_KEEP = 5
|
||||
|
||||
def validate_env_vars():
|
||||
@@ -34,6 +35,10 @@ def clean_files():
|
||||
for bucket in buckets:
|
||||
try:
|
||||
bucket_name = bucket['Name']
|
||||
# Skip excluded buckets
|
||||
if bucket_name in EXCLUDE_BUCKETS:
|
||||
print(f'Skipping excluded bucket: {bucket_name}')
|
||||
continue
|
||||
print(f'Bucket: {bucket_name}')
|
||||
|
||||
# Get all files in the bucket
|
||||
|
||||
Reference in New Issue
Block a user