-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrun_init.py
30 lines (20 loc) · 936 Bytes
/
run_init.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
from compass_contributor.contributor_org import ContributorOrgService
from compass_contributor.organization import OrganizationService
from compass_contributor.bot import BotService
import yaml
import logging
logger = logging.getLogger(__name__)
if __name__ == '__main__':
config_url = './conf-github.yaml'
CONF = yaml.safe_load(open(config_url))
elastic_url = CONF['url']
params = CONF['params']
contributor = ContributorOrgService(elastic_url, params['contributors_org_index'], "github")
contributor.save_by_cncf_gitdm_url()
logger.info(f"finish init contributor org by cncf gitdm")
organization = OrganizationService(elastic_url, params['organizations_index'])
organization.save_by_config_file()
logger.info(f"finish init organization by config")
bot = BotService(elastic_url, params['bots_index'])
bot.save_by_config_file()
logger.info(f"finish init bot by config")