diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-05-30 11:59:27 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-05-30 11:59:27 -0700 |
commit | a4b84445a96c0fbe6133331b02f96cf570c59149 (patch) | |
tree | 87113322452e30c3b06e51b3c8bc92031d7eab86 /python/fatcat_worker.py | |
parent | e89814d321dcaa2a7d62b429e5c09a7eef2173bf (diff) | |
download | fatcat-a4b84445a96c0fbe6133331b02f96cf570c59149.tar.gz fatcat-a4b84445a96c0fbe6133331b02f96cf570c59149.zip |
add container update elastic worker
Diffstat (limited to 'python/fatcat_worker.py')
-rwxr-xr-x | python/fatcat_worker.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/python/fatcat_worker.py b/python/fatcat_worker.py index 267779ff..4455d29e 100755 --- a/python/fatcat_worker.py +++ b/python/fatcat_worker.py @@ -38,6 +38,13 @@ def run_elasticsearch_release(args): elasticsearch_index=args.elasticsearch_index) worker.run() +def run_elasticsearch_container(args): + consume_topic = "fatcat-{}.container-updates".format(args.env) + worker = ElasticsearchContainerWorker(args.kafka_hosts, consume_topic, + elasticsearch_backend=args.elasticsearch_backend, + elasticsearch_index=args.elasticsearch_index) + worker.run() + def main(): parser = argparse.ArgumentParser() parser.add_argument('--debug', @@ -72,6 +79,15 @@ def main(): help="elasticsearch index to push into", default="fatcat_release_v03") + sub_elasticsearch_container = subparsers.add_parser('elasticsearch-container') + sub_elasticsearch_container.set_defaults(func=run_elasticsearch_container) + sub_elasticsearch_container.add_argument('--elasticsearch-backend', + help="elasticsearch backend to connect to", + default="http://localhost:9200") + sub_elasticsearch_container.add_argument('--elasticsearch-index', + help="elasticsearch index to push into", + default="fatcat_container") + args = parser.parse_args() if not args.__dict__.get("func"): print("tell me what to do!") |