From 27f3eaf9e91666dd4573ff79bb5528e2e49c9658 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" Date: Wed, 27 Jun 2018 09:52:55 +0200 Subject: [PATCH] README: Fix and document how to boostrap github lister model --- README.md | 8 ++++++++ bin/ghlister | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a65e7de..e555a08 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,17 @@ More details in requirements*.txt Local deployment ----------- +## lister-github + 1. git clone under $GHLISTER_ROOT (of your choosing) 2. mkdir ~/.config/swh/ ~/.cache/swh/lister/github.com/ 3. create configuration file ~/.config/swh/lister-github.com.yml +4. Bootstrap the db instance schema + +``` sh +$ createdb lister-github.com +$ bin/ghlister --db-url postgres:///lister-github.com createdb +``` Configuration file samples ------------------------- diff --git a/bin/ghlister b/bin/ghlister index 594f138..d8e6cf5 100755 --- a/bin/ghlister +++ b/bin/ghlister @@ -80,12 +80,14 @@ if __name__ == '__main__': if args.db_url: override_conf['lister_db_url'] = args.db_url - lister = GitHubLister(override_conf) + lister = GitHubLister(lister_name='github.com', + api_baseurl='https://api.github.com', + override_config=override_conf) if args.action == 'createdb': - models.SQLBase.metadata.create_all(lister.db_engine) + models.ModelBase.metadata.create_all(lister.db_engine) elif args.action == 'dropdb': - models.SQLBase.metadata.drop_all(lister.db_engine) + models.ModelBase.metadata.drop_all(lister.db_engine) elif args.action == 'list': lister.fetch(min_id=args.interval[0], max_id=args.interval[1])