-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsync_rebuilt.mk
38 lines (27 loc) · 1.26 KB
/
sync_rebuilt.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$(call log.debug, COOKBOOK BEGIN INCLUDE: cookbook/sync_rebuilt.mk)
###############################################################################
# SYNC REBUILT DATA TARGETS
# Targets for synchronizing rebuilt data from S3 to local storage
###############################################################################
# TARGET: sync-input-rebuilt
# Synchronizes rebuilt input data from S3 to local directory
sync-input:: sync-input-rebuilt
PHONY_TARGETS += sync-input
# Local synchronization stamp file for rebuilt input data
LOCAL_REBUILT_SYNC_STAMP_FILE := $(LOCAL_PATH_REBUILT).last_synced
$(call log.debug, LOCAL_REBUILT_SYNC_STAMP_FILE)
sync-input-rebuilt: $(LOCAL_REBUILT_SYNC_STAMP_FILE)
PHONY_TARGETS += sync-input-rebuilt
# the suffix of for the local stamp files (added to the input paths on s3)
LOCAL_REBUILT_STAMP_SUFFIX ?= .stamp
$(call log.debug, LOCAL_REBUILT_STAMP_SUFFIX)
# Rule to sync the input data from the S3 bucket to the local directory
$(LOCAL_PATH_REBUILT).last_synced:
mkdir -p $(@D) && \
python lib/s3_to_local_stamps.py \
$(S3_PATH_REBUILT) \
--local-dir $(BUILD_DIR) \
--stamp-extension $(LOCAL_REBUILT_STAMP_SUFFIX) \
--logfile [email protected] && \
touch $@
$(call log.debug, COOKBOOK END INCLUDE: cookbook/sync_rebuilt.mk)