From 0b9eed7fcf353ac6c1f44e181b7943f907f97cab Mon Sep 17 00:00:00 2001 From: Robert McNees <86265089+robertmcnees@users.noreply.github.com> Date: Mon, 15 Nov 2021 15:31:07 -0500 Subject: [PATCH] Modified usage of cache for CircleCI (#1999) --- .circleci/config.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b543c18..4a8ff58b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,21 +8,25 @@ jobs: # user: appuser environment: _JAVA_OPTIONS: "-Xms1024m -Xmx2048m" + CACHEVER: 1 TERM: dumb branches: ignore: - gh-pages # list of branches to ignore steps: - checkout -# - restore_cache: -# key: sc-config-{{ .Branch }} + - type: shell + name: "Write CACHEVER to file" + command: echo "$CACHEVER" > ~/CACHEVER.txt + - restore_cache: + key: sc-config-{{ .Branch }}-{{ checksum "~/CACHEVER.txt" }} - run: name: "Download dependencies" command: ./mvnw -s .settings.xml -U --fail-never dependency:go-offline || true -# - save_cache: -# key: sc-config-{{ .Branch }} -# paths: -# - ~/.m2 + - save_cache: + key: sc-config-{{ .Branch }}-{{ checksum "~/CACHEVER.txt" }} + paths: + - ~/.m2 - run: name: "Running build" command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar,withoutDockerTests -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn