def deploy(): """ The deploy hook. :return: """ print('... processing deploy tasks') tasks.create_data_dir() tasks.create_export_dir()
def export_data_dir(): """ Exports the media files of the application and bundles a zip archive :return: the target path of the zip archive """ from django_productline import utils from django.conf import settings import time tasks.create_export_dir() print('*** Exporting DATA_DIR') filename = '{number}.zip'.format( number=time.time() ) target_path = os.path.join(settings.EXPORT_DIR, filename) utils.zipdir(settings.PRODUCT_CONTEXT.DATA_DIR, target_path, wrapdir='__data__') print('... wrote {target_path}'.format(target_path=target_path)) return target_path