Currently, changes to nearly any file in the repository will cause
`docker build` to have to reinitialize the python environment and
the Java environment.

This change reorders some of the commands and copies in dependent files
incrementally in order to maximize caching and make repeated test runs
move faster.
This commit is contained in:
Jeff Klukas 2020-05-12 14:51:05 -04:00
Родитель 22ce6d8ada
Коммит 11d3fa2ca8
1 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -19,22 +19,29 @@ RUN dnf -y update && \
cargo \
&& dnf clean all
# Install jsonschema-transpiler
ENV PATH=$PATH:/root/.cargo/bin
RUN cargo install jsonschema-transpiler --version 1.8.0
# Configure git for testing
RUN git config --global user.email "mozilla-pipeline-schemas@mozilla.com"
RUN git config --global user.name "Mozilla Pipeline Schemas"
WORKDIR /app
COPY . /app
# Install python dependencies
COPY requirements.txt .
RUN pip3 install -r requirements.txt
# Install Java dependencies
COPY pom.xml .
RUN mvn dependency:copy-dependencies
RUN rm -rf /app/release && \
mkdir /app/release && \
COPY . /app
RUN mkdir release && \
cd release && \
cmake .. && \
make
WORKDIR /app
CMD pytest -v