Skip to content

Commit

Permalink
Docker: Clean build cache when critical files change
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Dec 3, 2018
1 parent 7a365b3 commit 4a4d0f8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/docker/scripts/ci_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ function upload_file {
wget --quiet --output-document=- --method=PUT --header="content-type: ${CONTENT_TYPE}" --header="cache-control: no-cache" --body-file="${FILE}" "${URL}" > /dev/null
}

# Calculate checksums of critical files.
CHECKSUMS=/workspace/checksums.md5
md5sum /workspace/cp2k/Makefile \
/workspace/cp2k/tools/build_utils/* \
/workspace/cp2k/arch/local* \
> $CHECKSUMS

# Get cp2k sources.
if [ -n "${GIT_REF}" ]; then
Expand Down Expand Up @@ -76,6 +82,13 @@ if [ -d /opt/cp2k-toolchain ]; then
fi
fi

if ! md5sum --status --check ${CHECKSUMS}; then
echo -e "\n========== Cleaning Build Cache ==========" | tee -a $REPORT
(md5sum --quiet --check ${CHECKSUMS} || true) |& tee -a $REPORT
cd /workspace/cp2k
make distclean |& tee -a $REPORT
fi

# Run actual test.
if $TOOLCHAIN_OK ; then
echo -e "\n========== Running Test ==========" | tee -a $REPORT
Expand Down

0 comments on commit 4a4d0f8

Please sign in to comment.