This repository has been archived by the owner on Aug 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/RadarParlamentar-UnBGama/…
…radar into timeline#187
- Loading branch information
Showing
23 changed files
with
575 additions
and
204 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
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 |
---|---|---|
@@ -1,3 +1,37 @@ | ||
#!/bin/bash | ||
# invoca rotinas de análise para que os resultados fiquem guardados no cache | ||
curl http://localhost/analises/json_analise/cmsp/BIENIO/ | ||
# Invoca rotinas de análise para que os resultados fiquem guardados no cache | ||
|
||
periodicidades=("QUADRIENIO" "BIENIO" "ANO" "SEMESTRE") | ||
casas_legislativas=("cmsp" "cdep" "sen") | ||
porta_development=8000 | ||
|
||
if [[ "$DJANGO_SETTINGS_MODULE" == "settings.development" ]]; then | ||
base_url="http://localhost:$porta_development" | ||
else | ||
base_url="http://localhost" | ||
fi | ||
|
||
echo "Iniciando a rotina de cache das analises em '$(date)'" | ||
inicio=$(date '+%s') | ||
|
||
for casa in ${casas_legislativas[*]}; do | ||
for periodicidade in ${periodicidades[*]}; do | ||
url="$base_url/analises/json_analise/$casa/$periodicidade/" | ||
echo "curl $url" | ||
curl --fail --silent --show-error $url > /dev/null | ||
|
||
rc=$? | ||
if [[ $rc != 0 ]]; then | ||
echo "Erro executando o curl para $url" | ||
fi | ||
done | ||
done | ||
|
||
fim=$(date '+%s') | ||
dt=$((fim - inicio)) | ||
ds=$((dt % 60)) | ||
dm=$(((dt / 60) % 60)) | ||
dh=$((dt / 3600)) | ||
|
||
echo "Finalizando a rotina de cache das analises em '$(date)'." | ||
printf "Se passaram %dh %02dmin %02ds\n\n" $dh $dm $ds |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
#!/bin/bash | ||
|
||
echo -e "Limpando o cache do radar" | ||
sudo rm -rf /tmp/django_cache/* |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
#!/bin/bash | ||
pg_dump -h localhost -U radar radar --inserts -t modelagem_* -f $RADAR_HOME/static/db-dump/radar.sql | ||
# Argumento: arquivo de saída (onde o dump será salvo) | ||
echo "Gerando dump completo do banco em '$(date)'" | ||
pg_dump -h localhost -U radar radar --inserts -t modelagem_* -f $1 |
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
Oops, something went wrong.