Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

feat: Cache Clojure dependencies #553

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ RUN mkdir /opt/boot-clj && cd /opt/boot-clj && \
chmod +x boot && \
ln -s /opt/boot-clj/boot /usr/local/bin/boot

# TODO: When upgrading to >= 1.10.1.672, also update approach for populating .m2 with clojure deps:
# In run-build-functions.sh replace `clojure -Spath -Sforce >/dev/null` with more modern `clojure -P`
RUN curl -sL https://download.clojure.org/install/linux-install-1.10.1.492.sh | bash

USER buildbot
Expand Down
18 changes: 18 additions & 0 deletions run-build-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,22 @@ install_dependencies() {
fi
fi

# Clojure CLI
if [ -f deps.edn ]
then
restore_home_cache ".m2" "maven dependencies"
restore_home_cache ".gitlibs" "clojure git dependencies"
restore_cwd_cache ".cpcache" "clojure classpath"
echo "Installing Clojure dependencies"
if clojure -Spath -Sforce >/dev/null
then
echo "Clojure dependencies installed"
else
echo "Error during Clojure install"
exit 1
fi
fi

# Hugo
if [ -n "$HUGO_VERSION" ]
then
Expand Down Expand Up @@ -700,6 +716,7 @@ cache_artifacts() {

cache_cwd_directory ".venv" "python virtualenv"
cache_cwd_directory ".build" "swift build"
cache_cwd_directory ".cpcache" "clojure classpath"
cache_cwd_directory ".netlify/plugins" "build plugins"
cache_cwd_directory ".netlify/rust-functions-cache" "Rust functions"

Expand All @@ -714,6 +731,7 @@ cache_artifacts() {
cache_home_directory ".emacs.d" "emacs cache"
cache_home_directory ".m2" "maven dependencies"
cache_home_directory ".boot" "boot dependencies"
cache_home_directory ".gitlibs" "clojure git dependencies"
cache_home_directory ".composer" "composer dependencies"
cache_home_directory ".homebrew-cache", "homebrew cache"
cache_home_directory ".rustup" "rust rustup cache"
Expand Down