From e5b06b18d7391c6123db56238982b91890060b26 Mon Sep 17 00:00:00 2001 From: Philip Wafula Date: Fri, 7 Jan 2022 10:50:49 +0000 Subject: [PATCH] Move cic-ussd datafiles to apps/cic-ussd/cic_ussd/data/ --- apps/cic-ussd/{var/lib => cic_ussd/data}/sys/guardians.txt | 0 apps/cic-ussd/{var/lib => cic_ussd/data}/sys/helpers.csv | 0 .../cic-ussd/{var/lib => cic_ussd/data}/sys/languages.json | 0 apps/cic-ussd/{var/lib => cic_ussd/data}/sys/sms.csv | 0 apps/cic-ussd/{var/lib => cic_ussd/data}/sys/ussd.csv | 0 apps/cic-ussd/cic_ussd/{db => data/sys}/ussd_menu.json | 0 apps/cic-ussd/config/app.ini | 2 +- apps/cic-ussd/config/test/app.ini | 2 +- apps/cic-ussd/config/test/translations.ini | 6 +++--- apps/cic-ussd/config/test/ussd.ini | 2 +- apps/cic-ussd/config/translations.ini | 6 +++--- apps/cic-ussd/config/ussd.ini | 2 +- apps/cic-ussd/docker/Dockerfile | 7 +++---- 13 files changed, 13 insertions(+), 14 deletions(-) rename apps/cic-ussd/{var/lib => cic_ussd/data}/sys/guardians.txt (100%) rename apps/cic-ussd/{var/lib => cic_ussd/data}/sys/helpers.csv (100%) rename apps/cic-ussd/{var/lib => cic_ussd/data}/sys/languages.json (100%) rename apps/cic-ussd/{var/lib => cic_ussd/data}/sys/sms.csv (100%) rename apps/cic-ussd/{var/lib => cic_ussd/data}/sys/ussd.csv (100%) rename apps/cic-ussd/cic_ussd/{db => data/sys}/ussd_menu.json (100%) diff --git a/apps/cic-ussd/var/lib/sys/guardians.txt b/apps/cic-ussd/cic_ussd/data/sys/guardians.txt similarity index 100% rename from apps/cic-ussd/var/lib/sys/guardians.txt rename to apps/cic-ussd/cic_ussd/data/sys/guardians.txt diff --git a/apps/cic-ussd/var/lib/sys/helpers.csv b/apps/cic-ussd/cic_ussd/data/sys/helpers.csv similarity index 100% rename from apps/cic-ussd/var/lib/sys/helpers.csv rename to apps/cic-ussd/cic_ussd/data/sys/helpers.csv diff --git a/apps/cic-ussd/var/lib/sys/languages.json b/apps/cic-ussd/cic_ussd/data/sys/languages.json similarity index 100% rename from apps/cic-ussd/var/lib/sys/languages.json rename to apps/cic-ussd/cic_ussd/data/sys/languages.json diff --git a/apps/cic-ussd/var/lib/sys/sms.csv b/apps/cic-ussd/cic_ussd/data/sys/sms.csv similarity index 100% rename from apps/cic-ussd/var/lib/sys/sms.csv rename to apps/cic-ussd/cic_ussd/data/sys/sms.csv diff --git a/apps/cic-ussd/var/lib/sys/ussd.csv b/apps/cic-ussd/cic_ussd/data/sys/ussd.csv similarity index 100% rename from apps/cic-ussd/var/lib/sys/ussd.csv rename to apps/cic-ussd/cic_ussd/data/sys/ussd.csv diff --git a/apps/cic-ussd/cic_ussd/db/ussd_menu.json b/apps/cic-ussd/cic_ussd/data/sys/ussd_menu.json similarity index 100% rename from apps/cic-ussd/cic_ussd/db/ussd_menu.json rename to apps/cic-ussd/cic_ussd/data/sys/ussd_menu.json diff --git a/apps/cic-ussd/config/app.ini b/apps/cic-ussd/config/app.ini index ebd5613c..0f31e250 100644 --- a/apps/cic-ussd/config/app.ini +++ b/apps/cic-ussd/config/app.ini @@ -13,4 +13,4 @@ port = ssl = [system] -guardians_file = var/lib/sys/guardians.txt +guardians_file = cic_ussd/data/sys/guardians.txt diff --git a/apps/cic-ussd/config/test/app.ini b/apps/cic-ussd/config/test/app.ini index e6f8218e..24d6a21e 100644 --- a/apps/cic-ussd/config/test/app.ini +++ b/apps/cic-ussd/config/test/app.ini @@ -8,4 +8,4 @@ states=states/ transitions=transitions/ [system] -guardians_file = var/lib/sys/guardians.txt +guardians_file = cic_ussd/data/sys/guardians.txt diff --git a/apps/cic-ussd/config/test/translations.ini b/apps/cic-ussd/config/test/translations.ini index 9676f435..414e3068 100644 --- a/apps/cic-ussd/config/test/translations.ini +++ b/apps/cic-ussd/config/test/translations.ini @@ -1,10 +1,10 @@ [locale] fallback=sw -path= -file_builders=var/lib/sys/ +path=cic_ussd/data/locale/ +file_builders=cic_ussd/data/sys/ [schema] file_path = data/schema [languages] -file = var/lib/sys/languages.json +file = cic_ussd/data/sys/languages.json diff --git a/apps/cic-ussd/config/test/ussd.ini b/apps/cic-ussd/config/test/ussd.ini index cb8ba9e0..47ad3bc3 100644 --- a/apps/cic-ussd/config/test/ussd.ini +++ b/apps/cic-ussd/config/test/ussd.ini @@ -1,5 +1,5 @@ [ussd] -menu_file=cic_ussd/db/ussd_menu.json +menu_file=cic_ussd/data/sys/ussd_menu.json service_code=*483*46#,*483*061#,*384*96# user = pass = diff --git a/apps/cic-ussd/config/translations.ini b/apps/cic-ussd/config/translations.ini index 5cf2ba19..829a7eac 100644 --- a/apps/cic-ussd/config/translations.ini +++ b/apps/cic-ussd/config/translations.ini @@ -1,10 +1,10 @@ [locale] fallback=sw -path=var/lib/locale/ -file_builders=var/lib/sys/ +path=cic_ussd/data/locale/ +file_builders=cic_ussd/data/sys/ [schema] file_path = /usr/local/lib/python3.8/site-packages/cic_translations/data/schema [languages] -file = var/lib/sys/languages.json +file = cic_ussd/data/sys/languages.json diff --git a/apps/cic-ussd/config/ussd.ini b/apps/cic-ussd/config/ussd.ini index d996d16d..47ad3bc3 100644 --- a/apps/cic-ussd/config/ussd.ini +++ b/apps/cic-ussd/config/ussd.ini @@ -1,5 +1,5 @@ [ussd] -menu_file=data/ussd_menu.json +menu_file=cic_ussd/data/sys/ussd_menu.json service_code=*483*46#,*483*061#,*384*96# user = pass = diff --git a/apps/cic-ussd/docker/Dockerfile b/apps/cic-ussd/docker/Dockerfile index 634c4299..0556bf1d 100644 --- a/apps/cic-ussd/docker/Dockerfile +++ b/apps/cic-ussd/docker/Dockerfile @@ -3,12 +3,10 @@ ARG DOCKER_REGISTRY="registry.gitlab.com/grassrootseconomics" FROM $DOCKER_REGISTRY/cic-base-images:python-3.8.6-dev-e8eb2ee2 RUN apt-get install -y redis-server + # create secrets directory RUN mkdir -vp pgp/keys -# create application directory -RUN mkdir -vp cic-ussd -RUN mkdir -vp data ARG EXTRA_PIP_INDEX_URL=https://pip.grassrootseconomics.net ARG EXTRA_PIP_ARGS="" @@ -25,7 +23,8 @@ RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ COPY . . RUN python setup.py install -COPY cic_ussd/db/ussd_menu.json data/ +# create local files directory +RUN mkdir -vp cic_ussd/data/locale COPY docker/*.sh ./ RUN chmod +x /root/*.sh