perf: 去掉django.po

pull/6932/head
ibuler 3 years ago
parent 082a5ae84c
commit b415ee051d

@ -35,12 +35,14 @@ RUN mkdir -p /root/.ssh/ \
&& echo "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null" > /root/.ssh/config && echo "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null" > /root/.ssh/config
RUN mkdir -p /opt/jumpserver/oracle/ \ RUN mkdir -p /opt/jumpserver/oracle/ \
&& wget https://download.jumpserver.org/public/instantclient-basiclite-linux.x64-21.1.0.0.0.tar \ && wget https://download.jumpserver.org/public/instantclient-basiclite-linux.x64-21.1.0.0.0.tar > /dev/null \
&& tar xf instantclient-basiclite-linux.x64-21.1.0.0.0.tar -C /opt/jumpserver/oracle/ \ && tar xf instantclient-basiclite-linux.x64-21.1.0.0.0.tar -C /opt/jumpserver/oracle/ \
&& echo "/opt/jumpserver/oracle/instantclient_21_1" > /etc/ld.so.conf.d/oracle-instantclient.conf \ && echo "/opt/jumpserver/oracle/instantclient_21_1" > /etc/ld.so.conf.d/oracle-instantclient.conf \
&& ldconfig \ && ldconfig \
&& rm -f instantclient-basiclite-linux.x64-21.1.0.0.0.tar && rm -f instantclient-basiclite-linux.x64-21.1.0.0.0.tar
RUN cd apps && python manage.py compilemessages
RUN echo > config.yml RUN echo > config.yml
VOLUME /opt/jumpserver/data VOLUME /opt/jumpserver/data
VOLUME /opt/jumpserver/logs VOLUME /opt/jumpserver/logs

@ -10,5 +10,6 @@ class CommonConfig(AppConfig):
def ready(self): def ready(self):
from . import signals_handlers from . import signals_handlers
from .signals import django_ready from .signals import django_ready
if 'migrate' not in sys.argv: if 'migrate' in sys.argv or 'compilemessages' in sys.argv:
django_ready.send(CommonConfig) return
django_ready.send(CommonConfig)

11
jms

@ -100,9 +100,20 @@ def collect_static():
logging.info("Collect static files done") logging.info("Collect static files done")
def compile_i81n_file():
django_mo_file = os.path.join(BASE_DIR, 'apps', 'locale', 'zh', 'LC_MESSAGES', 'django.mo')
if os.path.exists(django_mo_file):
return
os.chdir(os.path.join(BASE_DIR, 'apps'))
_cmd = 'python3 manage.py compilemessages --no-input -c &> /dev/null '
subprocess.call(_cmd, shell=True)
logging.info("Compile i18n files done")
def upgrade_db(): def upgrade_db():
collect_static() collect_static()
perform_db_migrate() perform_db_migrate()
collect_static()
def prepare(): def prepare():

@ -1 +1 @@
g++ make iputils-ping default-libmysqlclient-dev libpq-dev libffi-dev libldap2-dev libsasl2-dev sshpass g++ make iputils-ping default-libmysqlclient-dev libpq-dev libffi-dev libldap2-dev libsasl2-dev sshpass gettext

@ -1 +1 @@
brew install libtiff libjpeg webp little-cms2 openssl brew install libtiff libjpeg webp little-cms2 openssl gettext

@ -1 +1 @@
gcc-c++ sshpass mariadb-devel openldap-devel gcc-c++ sshpass mariadb-devel openldap-devel gettext

Loading…
Cancel
Save