-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_model_archiving_local.py
33 lines (28 loc) · 1.39 KB
/
data_model_archiving_local.py
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
import argparse
import os
from neo4j_summary_local import process_arguments
from bento.common.utils import get_logger, LOG_PREFIX, APP_NAME
from data_model_archiving import data_model_archiving
S3_BUCKET = "s3_bucket"
S3_FOLDER = "s3_prefix"
DATA_MODEL_REPO = "data_model_repo_url"
DATA_MODEL_VERSION = "data_model_version"
if LOG_PREFIX not in os.environ:
os.environ[LOG_PREFIX] = 'Data_Model_Archiving'
os.environ[APP_NAME] = 'Data_Model_Archiving'
argument_list = [DATA_MODEL_REPO, DATA_MODEL_REPO, S3_FOLDER, S3_BUCKET]
def parse_arguments():
parser = argparse.ArgumentParser(description='Data model archiving')
parser.add_argument('config_file', help='Confguration file', nargs='?', default=None)
parser.add_argument('--data-model-repo-url', help='The data model repository GitHub URL')
parser.add_argument('--data-model-version', help='The data model repository GitHub URL')
parser.add_argument('--s3-bucket', help='The upload s3 file bucket')
parser.add_argument('--s3-prefix', help='The upload s3 file folder')
return parser.parse_args()
def main(args):
log = get_logger('Data Model Archiving')
config = process_arguments(args, log, argument_list)
config_data = config.data
data_model_archiving(config_data[DATA_MODEL_REPO], config_data[DATA_MODEL_VERSION], config_data[S3_BUCKET], config_data[S3_FOLDER])
if __name__ == '__main__':
main(parse_arguments())