-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved auto-population script (#1679)
* Faster data loading scripts - Group related database updates into commits - Create quick-populate script to handle loading a basic database * Add secondary devcontainer - allow prebuilt codespace to have loaded data
- Loading branch information
Showing
7 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "theyworkforyou", | ||
|
||
"dockerComposeFile": "../../docker-compose.yml", | ||
"service": "twfy", | ||
"workspaceFolder": "/twfy", | ||
"initializeCommand": [ | ||
".devcontainer/initializeCommand" | ||
], | ||
"onCreateCommand": "script/quick-populate", | ||
"portsAttributes": {"8000": {"label": "TWFY"}}, | ||
"forwardPorts": [8000], | ||
|
||
"extensions": [ | ||
"ms-vscode.test-adapter-converter", | ||
"ms-azuretools.vscode-docker", | ||
"bmewburn.vscode-intelephense-client", | ||
"felixfbecker.php-debug", | ||
"recca0120.vscode-phpunit" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
# For a fresh install get a basic set of data in | ||
|
||
echo 'Cloning parlparse' | ||
git clone https://github.com/mysociety/parlparse data/parlparse --depth 1 | ||
|
||
# See http://parser.theyworkforyou.com/hansard.html for details on download specific ranges | ||
echo 'Downloading minimal data' | ||
rsync -az --progress --exclude '.svn' --exclude 'tmp/' --relative data.theyworkforyou.com::parldata/scrapedxml/debates/debates2022-01* data/pwdata | ||
rsync -az --progress --exclude '.svn' --exclude 'tmp/' --relative data.theyworkforyou.com::parldata/scrapedjson data/pwdata | ||
rsync -az --progress --exclude '.svn' --exclude 'tmp/' --relative data.theyworkforyou.com::parldata/people.json data/pwdata | ||
rsync -az --progress --exclude '.svn' --exclude 'tmp/' --relative data.theyworkforyou.com::parldata/scrapedxml/divisionsonly/divisions2022-01* data/pwdata | ||
rsync -az --progress --exclude '.svn' --exclude 'tmp/' --relative data.theyworkforyou.com::parldata/scrapedxml/regmem data/pwdata | ||
|
||
echo 'Load people into database' | ||
scripts/load-people | ||
|
||
echo 'Load divisions/policies from json' | ||
scripts/json2db.pl --verbose | ||
|
||
echo 'Load Jan 2022 debates and divisions' | ||
scripts/xml2db.pl --debates --all | ||
|
||
# this only imports public whip, run with different arguments to pull in members expenses | ||
echo 'Importing MP extra info for voting comparison' | ||
scripts/mpinfoin.pl publicwhip | ||
|
||
echo 'Generate party positions on issues' | ||
php scripts/generate_party_positions.php | ||
|
||
echo 'Generate search index' | ||
search/index.pl all |