diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-12-05 18:23:32 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-12-05 18:23:32 +0100 |
| commit | 03ed12b471c1e50ae531c46fcbf5afd06ca5432b (patch) | |
| tree | 67f48d66b2e9def2e514359b150e5f1384d9a3d2 /builder/s3.py | |
| parent | 2a1b884e841efe562e0c84885a404819433b3405 (diff) | |
build
Diffstat (limited to 'builder/s3.py')
| -rw-r--r-- | builder/s3.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/builder/s3.py b/builder/s3.py index f3dcce48..41ecdf61 100644 --- a/builder/s3.py +++ b/builder/s3.py @@ -18,6 +18,9 @@ def sync_directory(base_fn, s3_path, metadata): for fn in glob.glob(os.path.join(base_fn, 'assets/*')): fns[os.path.basename(fn)] = True + if not metadata['sync']: + return + remote_path = s3_path + metadata['url'] directory = s3_client.list_objects(Bucket=os.getenv('S3_BUCKET'), Prefix=remote_path) @@ -53,3 +56,6 @@ def sync_directory(base_fn, s3_path, metadata): os.getenv('S3_BUCKET'), s3_fn, ExtraArgs={ 'ACL': 'public-read' }) + +def make_s3_path(s3_dir, metadata_path): + return "{}/{}/{}{}".format(os.getenv('S3_ENDPOINT'), os.getenv('S3_BUCKET'), s3_dir, metadata_path) |
