Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
894 B
3
Indexable
Never
from vitruvian_rule_executor.services.rule_executor_service import RuleExecutorService
from argparse import ArgumentParser
from pathlib import Path
import sys
import os


def main():
    parser = ArgumentParser(prog="Rule Executor", description="Execute a provided set of rules")
    parser.add_argument("--mongodb_secret_name", help="MongoDB vault secret", default='enjoy-svc-mongodb', type=str)
    parser.add_argument("--config_key", help="Config key", type=str, required=True)
    args = parser.parse_args()
    root_dir = Path(__file__).parent
    resources_dir = os.path.join(root_dir, "resources")
    ruleExecutorSrv: RuleExecutorService = RuleExecutorService(
        mongodb_secret_name=args.mongodb_secret_name,
        config_key=args.config_key,
        resources_dir=resources_dir
    )
    ruleExecutorSrv.execute()
    return 0


if __name__ == "__main__":
    sys.exit(main())
Leave a Comment