mirror of
https://github.com/pretix/pretix.git
synced 2026-08-06 10:07:50 +00:00
Add npminstall to pip and docker build processes
This commit is contained in:
+6
-3
@@ -1,4 +1,4 @@
|
||||
FROM python:3.8
|
||||
FROM python:3.9
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
@@ -31,7 +31,11 @@ RUN apt-get update && \
|
||||
useradd -ms /bin/bash -d /pretix -u 15371 pretixuser && \
|
||||
echo 'pretixuser ALL=(ALL) NOPASSWD:SETENV: /usr/bin/supervisord' >> /etc/sudoers && \
|
||||
mkdir /static && \
|
||||
mkdir /etc/supervisord
|
||||
mkdir /etc/supervisord && \
|
||||
curl -fsSL https://deb.nodesource.com/setup_15.x | sudo -E bash - && \
|
||||
apt-get install -y nodejs && \
|
||||
curl -qL https://www.npmjs.com/install.sh | sh
|
||||
|
||||
|
||||
ENV LC_ALL=C.UTF-8 \
|
||||
DJANGO_SETTINGS_MODULE=production_settings
|
||||
@@ -67,7 +71,6 @@ RUN chmod +x /usr/local/bin/pretix && \
|
||||
rm -f pretix.cfg && \
|
||||
mkdir -p data && \
|
||||
chown -R pretixuser:pretixuser /pretix /data data && \
|
||||
sudo -u pretixuser make npminstall && \
|
||||
sudo -u pretixuser make production
|
||||
|
||||
USER pretixuser
|
||||
|
||||
@@ -25,6 +25,7 @@ coverage:
|
||||
coverage run -m py.test
|
||||
|
||||
npminstall:
|
||||
# keep this in sync with setup.py!
|
||||
mkdir -p pretix/static.dist/node_prefix/
|
||||
cp -r pretix/static/npm_dir/* pretix/static.dist/node_prefix/
|
||||
npm install --prefix=pretix/static.dist/node_prefix
|
||||
|
||||
@@ -2,7 +2,9 @@ import os
|
||||
import sys
|
||||
from codecs import open
|
||||
from distutils.command.build import build
|
||||
from distutils.dir_util import copy_tree
|
||||
from os import path
|
||||
import subprocess
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
@@ -51,10 +53,17 @@ class CustomBuild(build):
|
||||
settings.COMPRESS_ENABLED = True
|
||||
settings.COMPRESS_OFFLINE = True
|
||||
|
||||
# keep this in sync with Makefile!
|
||||
node_prefix = os.path.join(settings.STATIC_ROOT, 'node_prefix')
|
||||
os.makedirs(node_prefix, exist_ok=True)
|
||||
copy_tree(os.path.join(here, 'pretix', 'static', 'npm_dir'), node_prefix)
|
||||
subprocess.check_call(['npm', 'install', '--prefix=' + node_prefix])
|
||||
|
||||
management.call_command('compilemessages', verbosity=1)
|
||||
management.call_command('compilejsi18n', verbosity=1)
|
||||
management.call_command('collectstatic', verbosity=1, interactive=False)
|
||||
management.call_command('compress', verbosity=1)
|
||||
|
||||
build.run(self)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user