Skip to content

Commit

Permalink
Merge pull request #94 from datosgobar/279-units_from_json_file
Browse files Browse the repository at this point in the history
 units from json file
  • Loading branch information
alejandrosobko authored May 2, 2019
2 parents b813dee + 5b5fd12 commit 3bd9e3f
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base_portal/roles/portal/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
src: ckan/licenses.json.j2
dest: "{{ CKAN_DIST_CONFIG }}/licenses.json"

- name: Add units JSON file
template:
src: ckan/units.json.j2
dest: "{{ CKAN_DIST_CONFIG }}/units.json"

- name: Configure supervisor
template:
src: ckan/supervisor-ckan-worker.conf.j2
Expand Down Expand Up @@ -94,6 +99,7 @@
- 0005_add_series_api_uri_default_value.sh
- 0006_remove_harvest_and_datajson_plugins.sh
- 0007_specify_licenses_json_path.sh
- 0008_specify_units_json_path.sh

- name: Add tests scripts
template:
Expand Down
1 change: 1 addition & 0 deletions base_portal/roles/portal/templates/ckan/production.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ ckan.display_timezone = server
#ckan.recaptcha.privatekey =
licenses_group_url = file:///var/lib/ckan/theme_config/licenses.json
# ckan.template_footer_end =
units_url = {{ CKAN_DIST_CONFIG }}/units.json


## Internationalisation Settings
Expand Down
98 changes: 98 additions & 0 deletions base_portal/roles/portal/templates/ckan/units.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[
"ARS corrientes",
"ARS",
"ARS/USD",
"Australes",
"Automóviles",
"Becas",
"Beneficiarios",
"Cabezas",
"Cantidad de pasajeros",
"Centavos de dólar por kilogramo",
"Coeficiente",
"Empresas",
"GWh",
"Grados centígrados",
"Habitantes",
"Hectáreas",
"Kbbl/d",
"M3",
"MW",
"Metros cúbicos",
"Metros",
"Miles de M2",
"Miles de USD CIF",
"Miles de USD FOB",
"Miles de UTEq",
"Miles de cabezas",
"Miles de dólares FOB",
"Miles de hectolitros",
"Miles de litros",
"Miles de litros",
"Miles de llamadas",
"Miles de líneas",
"Miles de metros cúbicos",
"Miles de minutos",
"Miles de pasajeros",
"Miles de pasajes",
"Miles de personas",
"Miles de teléfonos",
"Miles de toneladas",
"Miles de unidades",
"Miles de vehículos",
"Millones de Litros",
"Millones de USD corrientes",
"Millones de USD de 2004",
"Millones de USD",
"Millones de cabezas",
"Millones de dólares de 1993",
"Millones de metros cúbicos",
"Millones de paquetes",
"Millones de pesos a precios de 1993",
"Millones de pesos a precios de 2004",
"Millones de pesos corrientes",
"Millones de pesos",
"Millones de unidades",
"Paquetes de 20 unidades",
"Pasajeros",
"Pasajes",
"Personas por sala",
"Personas",
"Porcentaje de hogares",
"Porcentaje de población",
"Porcentaje del PBI",
"Porcentaje del total de exportaciones",
"Porcentaje",
"Pozos",
"Prestaciones",
"Puestos de trabajo",
"Reales por dólar",
"Reales",
"Salas",
"Tasa",
"Toneladas",
"USD corrientes",
"USD corrientes",
"USD por tonelada",
"USD",
"USD/GBP",
"USD/KG",
"USD/M3",
"USD/millón de BTU",
"Unidades",
"Variación interanual",
"Variación intermensual",
"Variación mensual",
"Variación porcentual",
"Índice 17 Diciembre 2015 = 100",
"Índice 1993 = 100",
"Índice 1997 = 100",
"Índice 1999 = 100",
"Índice 2004 = 100",
"Índice 2005 = 100",
"Índice 2012 = 100",
"Índice Abril 2008 = 100",
"Índice Diciembre 2001 = 100",
"Índice Diciembre 2016 = 100",
"Índice Noviembre 2015 = 100"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

units_json_path=/app/roles/portal/templates/ckan/units.json.j2
units_json_final_path={{ CKAN_DIST_CONFIG }}/units.json
config_file="{{ CKAN_CONFIG }}/{{ CKAN_CONFIG_FILE }}";

if ! grep -q "units_url" "$config_file"; then
var=$(grep -n '\[app:main\]' $config_file | awk -F ":" '{print $1}')
let "var=var+1"
sed -i "${var}i units_url = $units_json_final_path" $config_file
cp $units_json_path $units_json_final_path
fi

0 comments on commit 3bd9e3f

Please sign in to comment.