Allow the example/load.py script to load other repos from CLI
This commit is contained in:
+2
-1
@@ -5,6 +5,7 @@ from __future__ import print_function
|
|||||||
from os.path import dirname, basename, abspath
|
from os.path import dirname, basename, abspath
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
|
import sys
|
||||||
|
|
||||||
import git
|
import git
|
||||||
|
|
||||||
@@ -177,7 +178,7 @@ if __name__ == '__main__':
|
|||||||
es = Elasticsearch()
|
es = Elasticsearch()
|
||||||
|
|
||||||
# we load the repo and all commits
|
# we load the repo and all commits
|
||||||
load_repo(es)
|
load_repo(es, path=sys.argv[1] if len(sys.argv) == 2 else None)
|
||||||
|
|
||||||
# run the bulk operations
|
# run the bulk operations
|
||||||
success, _ = bulk(es, REPO_ACTIONS, index='git', raise_on_error=True)
|
success, _ = bulk(es, REPO_ACTIONS, index='git', raise_on_error=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user