Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Political Memory
memopol
Commits
20adc5dd
Commit
20adc5dd
authored
Sep 16, 2016
by
Nicolas Joyard
Browse files
Update scripts
parent
08081f26
Changes
6
Hide whitespace changes
Inline
Side-by-side
bin/lib.sh
View file @
20adc5dd
...
...
@@ -2,7 +2,7 @@ if [ -n "$OPENSHIFT_HOMEDIR" ]; then
source
${
OPENSHIFT_HOMEDIR
}
app-root/runtime/dependencies/python/virtenv/bin/activate
fi
function
p
ipe
_download_
to_command
()
{
function
p
arltrack
_download_
pipe
()
{
if
[
-n
"
$OPENSHIFT_DATA_DIR
"
]
;
then
cd
$OPENSHIFT_DATA_DIR
fi
...
...
@@ -18,3 +18,20 @@ function pipe_download_to_command() {
unxz
-c
${
OPENSHIFT_DATA_DIR
}
$1
|
$2
[
-n
"
$CLEAN
"
]
&&
rm
-rf
$1
}
function
francedata_download_pipe
()
{
if
[
-n
"
$OPENSHIFT_DATA_DIR
"
]
;
then
cd
$OPENSHIFT_DATA_DIR
fi
[
-n
"
$CLEAN
"
]
&&
rm
-rf
$1
[
-f
"
$1
"
]
||
wget https://francedata-njoyard.rhcloud.com/
$1
||
exit
1
if
[
-n
"
$OPENSHIFT_REPO_DIR
"
]
;
then
cd
$OPENSHIFT_REPO_DIR
fi
export
DJANGO_SETTINGS_MODULE
=
memopol.settings
gunzip
-c
${
OPENSHIFT_DATA_DIR
}
$1
|
$2
[
-n
"
$CLEAN
"
]
&&
rm
-rf
$1
}
bin/update_all
View file @
20adc5dd
...
...
@@ -2,11 +2,14 @@
bin/update_representatives
# grace time for pg
sleep
120
sleep
10
bin/update_dossiers
sleep
120
sleep
10
bin/update_proposals
sleep
10
bin/update_votes
bin/update_dossiers
View file @
20adc5dd
...
...
@@ -3,4 +3,8 @@ set -ex
source
${
OPENSHIFT_REPO_DIR
}
bin/lib.sh
pipe_download_to_command ep_dossiers.json.xz parltrack_import_dossiers
parltrack_download_pipe ep_dossiers.json.xz parltrack_import_dossiers
sleep
10
francedata_download_pipe dossiers.json.gz francedata_import_dossiers
bin/update_proposals
0 → 100644
View file @
20adc5dd
#!/bin/bash
set
-ex
source
${
OPENSHIFT_REPO_DIR
}
bin/lib.sh
# Nothing for parltrack - proposals imported with votes
francedata_download_pipe scrutins.json.gz francedata_import_scrutins
bin/update_representatives
View file @
20adc5dd
...
...
@@ -3,4 +3,8 @@ set -ex
source
${
OPENSHIFT_REPO_DIR
}
bin/lib.sh
pipe_download_to_command ep_meps_current.json.xz parltrack_import_representatives
parltrack_download_pipe ep_meps_current.json.xz parltrack_import_representatives
sleep
10
francedata_download_pipe parlementaires.json.gz francedata_import_representatives
bin/update_votes
View file @
20adc5dd
...
...
@@ -3,4 +3,8 @@ set -ex
source
${
OPENSHIFT_REPO_DIR
}
bin/lib.sh
pipe_download_to_command ep_votes.json.xz parltrack_import_votes
parltrack_download_pipe ep_votes.json.xz parltrack_import_votes
sleep
10
francedata_download_pipe votes.json.gz francedata_import_votes
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment