From dc80b7ecb9be6c271de2c192852f26f7630b8d53 Mon Sep 17 00:00:00 2001 From: Jaime Fullaondo Date: Wed, 2 Dec 2020 15:04:06 +0100 Subject: [PATCH] [circleci] tie cache to java version --- .circleci/config.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83dd06b6..4c79c972 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,22 +1,35 @@ version: 2.1 +commands: + create_custom_cache_lock: + description: "Create custom cache lock for java version." + parameters: + filename: + type: string + steps: + - run: + name: Grab java package and dump to file + command: dpkg -S $(readlink -f /usr/bin/java) | cut -f1 -d':' > << parameters.filename >> + default_steps: &default_steps steps: - checkout + - create_custom_cache_lock: + filename: java-package-lock.txt # Download and cache dependencies - restore_cache: keys: - - -v5-dependencies-{{ checksum "pom.xml" }}-{{ arch }} + - -v6-dependencies-{{ checksum "pom.xml" }}-{{ checksum "java-package-lock.txt" }}-{{ arch }} # fallback to using the latest cache if no exact match is found - - -v5-dependencies- + - -v6-dependencies- - run: mvn dependency:go-offline - save_cache: paths: - ~/.m2 - key: -v5-dependencies-{{ checksum "pom.xml" }}-{{ arch }} + key: -v6-dependencies-{{ checksum "pom.xml" }}-{{ checksum "java-package-lock.txt" }}-{{ arch }} - run: | mvn clean install -Dgpg.skip $MVN_EXTRA_OPTS