diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-12-15 21:43:04 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-12-15 21:43:04 +0100 |
| commit | 50a35da0c14664bd3e1392254afec21ef3880440 (patch) | |
| tree | ba8a1e506a8c9fc96b73f7107acee31f9e9859c1 /megapixels/app/builder/s3.py | |
| parent | e0b0b2f976c61225a178c7715caf2656a1f6741f (diff) | |
make builder a click script
Diffstat (limited to 'megapixels/app/builder/s3.py')
| -rw-r--r-- | megapixels/app/builder/s3.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/megapixels/app/builder/s3.py b/megapixels/app/builder/s3.py index 41ecdf61..99726a4d 100644 --- a/megapixels/app/builder/s3.py +++ b/megapixels/app/builder/s3.py @@ -1,17 +1,6 @@ import os import glob import boto3 -from paths import * - -session = boto3.session.Session() - -s3_client = session.client( - service_name='s3', - aws_access_key_id=os.getenv('S3_KEY'), - aws_secret_access_key=os.getenv('S3_SECRET'), - endpoint_url=os.getenv('S3_ENDPOINT'), - region_name=os.getenv('S3_REGION'), -) def sync_directory(base_fn, s3_path, metadata): fns = {} @@ -23,6 +12,16 @@ def sync_directory(base_fn, s3_path, metadata): remote_path = s3_path + metadata['url'] + session = boto3.session.Session() + + s3_client = session.client( + service_name='s3', + aws_access_key_id=os.getenv('S3_KEY'), + aws_secret_access_key=os.getenv('S3_SECRET'), + endpoint_url=os.getenv('S3_ENDPOINT'), + region_name=os.getenv('S3_REGION'), + ) + directory = s3_client.list_objects(Bucket=os.getenv('S3_BUCKET'), Prefix=remote_path) prefixes = [] |
