Move build steps for better caching strategy

This commit is contained in:
ChrisTerBeke 2018-03-01 11:45:40 +01:00
parent 700254ffc9
commit 2b0211a45f

View File

@ -1,32 +1,13 @@
FROM ultimaker/cura-build-environment:1 FROM ultimaker/cura-build-environment:1
# Environment vars for easy configuration # Environment vars for easy configuration
ENV CURA_BENV_BUILD_TYPE=Release
ENV CURA_BRANCH=docker
ENV URANIUM_BRANCH=master
ENV CURA_ENGINE_BRANCH=master
ENV MATERIALS_BRANCH=master
ENV CURA_APP_DIR=/srv/cura ENV CURA_APP_DIR=/srv/cura
# Ensure our sources dir exists # Ensure our sources dir exists
RUN mkdir $CURA_APP_DIR RUN mkdir $CURA_APP_DIR
# Setup Uranium
WORKDIR $CURA_APP_DIR
RUN git clone -b $URANIUM_BRANCH --depth 1 https://github.com/Ultimaker/Uranium
WORKDIR $CURA_APP_DIR/Uranium
# Setup Cura
WORKDIR $CURA_APP_DIR
RUN git clone -b $CURA_BRANCH --depth 1 https://github.com/Ultimaker/Cura
WORKDIR $CURA_APP_DIR/Cura
# Setup materials
WORKDIR $CURA_APP_DIR/Cura/resources
RUN git clone -b $MATERIALS_BRANCH --depth 1 https://github.com/Ultimaker/fdm_materials materials
WORKDIR $CURA_APP_DIR/Cura/resources/materials
# Setup CuraEngine # Setup CuraEngine
ENV CURA_ENGINE_BRANCH=master
WORKDIR $CURA_APP_DIR WORKDIR $CURA_APP_DIR
RUN git clone -b $CURA_ENGINE_BRANCH --depth 1 https://github.com/Ultimaker/CuraEngine RUN git clone -b $CURA_ENGINE_BRANCH --depth 1 https://github.com/Ultimaker/CuraEngine
WORKDIR $CURA_APP_DIR/CuraEngine WORKDIR $CURA_APP_DIR/CuraEngine
@ -38,6 +19,24 @@ RUN make install
# TODO: setup libCharon # TODO: setup libCharon
# Setup Uranium
ENV URANIUM_BRANCH=master
WORKDIR $CURA_APP_DIR
RUN git clone -b $URANIUM_BRANCH --depth 1 https://github.com/Ultimaker/Uranium
WORKDIR $CURA_APP_DIR/Uranium
# Setup materials
ENV MATERIALS_BRANCH=master
WORKDIR $CURA_APP_DIR/Cura/resources
RUN git clone -b $MATERIALS_BRANCH --depth 1 https://github.com/Ultimaker/fdm_materials materials
WORKDIR $CURA_APP_DIR/Cura/resources/materials
# Setup Cura
ENV CURA_BRANCH=docker
WORKDIR $CURA_APP_DIR
RUN git clone -b $CURA_BRANCH --depth 1 https://github.com/Ultimaker/Cura
WORKDIR $CURA_APP_DIR/Cura
# Make sure Cura can find CuraEngine # Make sure Cura can find CuraEngine
RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura