我想在.gitlab.yml文件中使用多个缓存
maven依赖、gradle Package 等的全局缓存。
每个生成的本地缓存(共享渐变生成输出)
似乎在执行构建/测试阶段时没有考虑全局缓存,因为gradle总是加载 Package 器。如何在构建阶段启用全局缓存?
image:
name: gradle:jdk11
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle_home
cache: &global_cache
key: gradle_global_cache
# files:
# - build.gradle
paths:
- $GRADLE_USER_HOME/caches
- $GRADLE_USER_HOME/wrapper
build:
stage: build
script: ./gradlew assemble
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull-push
paths:
- build
- .gradle
test:
stage: test
script: ./gradlew check
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle
暂无答案!
目前还没有任何答案,快来回答吧!