Simplify package structure

This commit is contained in:
Kristóf Tóth 2019-07-24 15:50:41 +02:00
parent a23224aced
commit 52399f413c
79 changed files with 22 additions and 24 deletions

View File

@ -54,10 +54,10 @@ COPY supervisor/components/ ${TFW_SUPERVISORD_COMPONENTS}
COPY nginx/nginx.conf ${TFW_NGINX_CONF} COPY nginx/nginx.conf ${TFW_NGINX_CONF}
COPY nginx/default.conf ${TFW_NGINX_DEFAULT} COPY nginx/default.conf ${TFW_NGINX_DEFAULT}
COPY nginx/components/ ${TFW_NGINX_COMPONENTS} COPY nginx/components/ ${TFW_NGINX_COMPONENTS}
COPY lib ${TFW_LIB_DIR}/ COPY tfw ${TFW_LIB_DIR}/tfw
COPY supervisor/tfw_server.py ${TFW_SERVER_DIR}/ COPY supervisor/tfw_server.py ${TFW_SERVER_DIR}/
RUN for dir in "${TFW_LIB_DIR}"/{tfw,tao,envvars} "/etc/nginx" "/etc/supervisor"; do \ RUN for dir in "${TFW_LIB_DIR}"/tfw "/etc/nginx" "/etc/supervisor"; do \
chown -R root:root "$dir" && chmod -R 700 "$dir"; \ chown -R root:root "$dir" && chmod -R 700 "$dir"; \
done done
@ -70,7 +70,7 @@ ONBUILD COPY ${BUILD_CONTEXT}/supervisor/ ${TFW_SUPERVISORD_COMPONENTS}
ONBUILD RUN for f in "${TFW_NGINX_DEFAULT}" ${TFW_NGINX_COMPONENTS}/*.conf; do \ ONBUILD RUN for f in "${TFW_NGINX_DEFAULT}" ${TFW_NGINX_COMPONENTS}/*.conf; do \
envsubst "$(printenv | cut -d= -f1 | grep TFW_ | sed -e 's/^/$/g')" < $f > $f~ && mv $f~ $f ;\ envsubst "$(printenv | cut -d= -f1 | grep TFW_ | sed -e 's/^/$/g')" < $f > $f~ && mv $f~ $f ;\
done done
ONBUILD VOLUME ["/etc/nginx", "/var/lib/nginx", "/var/log/nginx", "${TFW_LIB_DIR}/envvars", "${TFW_LIB_DIR}/tfw"] ONBUILD VOLUME ["/etc/nginx", "/var/lib/nginx", "/var/log/nginx", "${TFW_LIB_DIR}/tfw"]
ONBUILD COPY ${BUILD_CONTEXT}/frontend /data/ ONBUILD COPY ${BUILD_CONTEXT}/frontend /data/
ONBUILD RUN test -z "${NOFRONTEND}" && cd /data && yarn install --frozen-lockfile || : ONBUILD RUN test -z "${NOFRONTEND}" && cd /data && yarn install --frozen-lockfile || :

View File

@ -1 +0,0 @@
from .envvars import TAOENV

View File

@ -1,3 +0,0 @@
from envvars import LazyEnvironment
TAOENV = LazyEnvironment('AVATAO_', 'taoenvtuple').environment

View File

@ -1 +0,0 @@
from .envvars import TFWENV

View File

@ -1,3 +0,0 @@
from envvars import LazyEnvironment
TFWENV = LazyEnvironment('TFW_', 'tfwenvtuple').environment

View File

@ -1,6 +1,6 @@
from os.path import dirname, realpath, join from os.path import dirname, realpath, join
from setuptools import setup, find_packages from setuptools import setup
here = dirname(realpath(__file__)) here = dirname(realpath(__file__))
@ -10,20 +10,20 @@ with open(join(here, 'requirements.txt'), 'r') as ifile:
requirements = ifile.read().splitlines() requirements = ifile.read().splitlines()
setup( setup(
name = 'tfw', name='tfw',
version = version, version=version,
description = 'Avatao tutorial-framework', description='Avatao tutorial-framework',
url = 'https://github.com/avatao-content/baseimage-tutorial-framework', url='https://github.com/avatao-content/baseimage-tutorial-framework',
author = 'Avatao.com Innovative Learning Kft.', author='Avatao.com Innovative Learning Kft.',
author_email = 'support@avatao.com', author_email='support@avatao.com',
license = 'custom', license='custom',
packages = find_packages('lib'), packages=['tfw'],
package_dir = {'': 'lib'}, package_dir={'tfw': 'tfw'},
install_requires = requirements, install_requires=requirements,
extras_require = { extras_require={
'docs': [ 'docs': [
'sphinx >= 1.7.0', 'sphinx >= 1.7.0',
], ],
}, },
zip_safe = False, zip_safe=False,
) )

1
tfw/config/__init__.py Normal file
View File

@ -0,0 +1 @@
from .envvars import TFWENV, TAOENV

5
tfw/config/envvars.py Normal file
View File

@ -0,0 +1,5 @@
from .lazy_environment import LazyEnvironment
TFWENV = LazyEnvironment('TFW_', 'tfwenvtuple').environment
TAOENV = LazyEnvironment('AVATAO_', 'taoenvtuple').environment