README: Fix and document how to boostrap github lister model
This commit is contained in:
parent
53c12d54c3
commit
27f3eaf9e9
2 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
-------------------------
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue