Merge pull request #3358 from KeyboardNerd/fix_license

Fix python license checking and uninstall docutils on build
This commit is contained in:
Sida Chen 2019-02-12 13:32:32 -05:00 committed by GitHub
commit 5808a84279
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,12 +77,22 @@ RUN curl -fsSL -o /usr/local/bin/prometheus-aggregator https://github.com/coreos
&& chmod +x /usr/local/bin/prometheus-aggregator
# Install python dependencies
# docutils is a setup dependency of botocore required by s3transfer. It's under
# GPLv3, and so should be removed.
COPY requirements.txt requirements-tests.txt ./
RUN virtualenv --distribute venv \
&& venv/bin/pip install -r requirements.txt \
&& venv/bin/pip install -r requirements-tests.txt \
&& (venv/bin/pip uninstall -y docutils || echo "docutils is not installed") \
&& venv/bin/pip freeze
# Check python dependencies for the GPL
# Due to the following bug, pip results must be piped to a file before grepping:
# https://github.com/pypa/pip/pull/3304
RUN venv/bin/pip freeze | grep -v "^-e" | awk -F'==' '{print $1}' | xargs venv/bin/pip --disable-pip-version-check show > pipinfo.txt && \
test -z "$(cat pipinfo.txt | grep GPL | grep -v LGPL)" && \
rm pipinfo.txt
# Install front-end dependencies
COPY static/ package.json tsconfig.json webpack.config.js tslint.json yarn.lock ./
RUN yarn install --ignore-engines
@ -99,12 +109,7 @@ RUN adduser memcached --disabled-login --system
WORKDIR $QUAYDIR
# Check python dependencies for the GPL
# Due to the following bug, pip results must be piped to a file before grepping:
# https://github.com/pypa/pip/pull/3304
RUN cat requirements.txt | grep -v "^-e" | awk -F'==' '{print $1}' | xargs venv/bin/pip --disable-pip-version-check show > pipinfo.txt && \
test -z "$(cat pipinfo.txt | grep GPL | grep -v LGPL)" && \
rm pipinfo.txt
# JS compile
COPY bill-of-materials.json bill-of-materials.json