Skip to content

Commit

Permalink
Add internal project dependency to Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jan 20, 2020
1 parent c994970 commit 8f32020
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ RUN USER=root cargo new --bin ${PROJECT_NAME}
WORKDIR ${WORKDIR_ROOT}/${PROJECT_NAME}

RUN USER=root cargo new --lib ofdb-boundary
RUN USER=root cargo new --lib ofdb-entities

COPY [ \
"Cargo.toml", \
Expand All @@ -46,6 +47,9 @@ COPY [ \
COPY [ \
"ofdb-boundary/Cargo.toml", \
"./ofdb-boundary/" ]
COPY [ \
"ofdb-entities/Cargo.toml", \
"./ofdb-entities/" ]

# Build the dummy project(s), then delete all build artefacts that must(!) not be cached
RUN cargo build --${BUILD_MODE} --target ${BUILD_TARGET} --workspace \
Expand All @@ -56,9 +60,13 @@ RUN cargo build --${BUILD_MODE} --target ${BUILD_TARGET} --workspace \
&& \
rm -f ./target/${BUILD_TARGET}/${BUILD_MODE}/deps/ofdb_boundary-* \
&& \
rm -f ./target/${BUILD_TARGET}/${BUILD_MODE}/deps/ofdb_entities-* \
&& \
rm -rf ./target/${BUILD_TARGET}/${BUILD_MODE}/.fingerprint/${PROJECT_NAME}-* \
&& \
rm -rf ./target/${BUILD_TARGET}/${BUILD_MODE}/.fingerprint/ofdb-boundary-*
rm -rf ./target/${BUILD_TARGET}/${BUILD_MODE}/.fingerprint/ofdb-boundary-* \
&& \
rm -rf ./target/${BUILD_TARGET}/${BUILD_MODE}/.fingerprint/ofdb-entities-*

# Copy all project (re-)sources that are required for building
COPY [ \
Expand All @@ -70,6 +78,9 @@ COPY [ \
COPY [ \
"ofdb-boundary/src", \
"./ofdb-boundary/src/" ]
COPY [ \
"ofdb-entities/src", \
"./ofdb-entities/src/" ]
COPY [ \
"openapi.yaml", \
"./" ]
Expand Down

0 comments on commit 8f32020

Please sign in to comment.