GitLab Runner cache for Gradle is not working -


i'm using gitlab runner ci build android project cache not working.

here's .gitlab-ci.yml. modified https://gist.github.com/daicham/5ac8461b8b49385244aa0977638c3420.

image: runmymind/docker-android-sdk:latest variables:   gradle_user_home: $ci_project_dir/.gradle stages:   - build debug:   stage: build   script:     - set +e     - du -sh $ci_project_dir/.gradle/wrapper     - du -sh $ci_project_dir/.gradle/caches     - set -e     - ./gradlew assembledebug     - mkdir artifacts     - cp mobile/build/outputs/apk/*.apk artifacts/     - cp wear/build/outputs/apk/*.apk artifacts/   cache:     paths:       - .gradle/wrapper/       - .gradle/caches/       - build/       - mobile/build/       - wear/build/   artifacts:     name: "project_${ci_job_name}_${ci_commit_ref_name}_${ci_commit_sha}"     expire_in: 2 weeks     paths:       - artifacts/ 

and log:

running gitlab-ci-multi-runner 9.0.0 (08a9e6f) using docker executor image runmymind/docker-android-sdk:latest ... using docker image sha256:d696fa13188c8d2d121c86cf526201b363c1e34ee7b163d6ce1ab1718f91a5e6 id=sha256:d696fa13188c8d2d121c86cf526201b363c1e34ee7b163d6ce1ab1718f91a5e6 predefined container... pulling docker image runmymind/docker-android-sdk:latest ... using docker image runmymind/docker-android-sdk:latest id=sha256:474ac98077a496f2f71aa22ce4eebcea966c2960a061d4a59babe81ff007009b build container... running on runner-8ce5d03c-project-72-concurrent-0 via outrage... cloning repository... cloning '/builds/user/android-project'... checking out 015d01d0 master... skipping git submodules setup checking cache default... extracted cache $ set +e $ du -sh $ci_project_dir/.gradle/wrapper du: cannot access '/builds/user/android-project/.gradle/wrapper': no such file or directory $ du -sh $ci_project_dir/.gradle/caches du: cannot access '/builds/user/android-project/.gradle/caches': no such file or directory $ set -e $ ./gradlew assembledebug downloading https://services.gradle.org/distributions/gradle-3.4.1-all.zip unzipping /builds/user/android-project/.gradle/wrapper/dists/gradle-3.4.1-all/c3ib5obfnqr0no9szq6qc17do/gradle-3.4.1-all.zip /builds/user/android-project/.gradle/wrapper/dists/gradle-3.4.1-all/c3ib5obfnqr0no9szq6qc17do set executable permissions for: /builds/user/android-project/.gradle/wrapper/dists/gradle-3.4.1-all/c3ib5obfnqr0no9szq6qc17do/gradle-3.4.1/bin/gradle starting gradle daemon (subsequent builds faster) download https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom (more downloads) 

i have tried using gradle argument set gradle user home, aggressively specifying .gradle/ cache, etc, none of them worked.

any ideas?

if use gitlab < 9.0,you add specify cache has shared among different pipelines.

try add key: $ci_project_name under cache:

image: runmymind/docker-android-sdk:latest variables:   gradle_user_home: $ci_project_dir/.gradle stages:   - build debug:   stage: build   script:     - set +e     - du -sh $ci_project_dir/.gradle/wrapper     - du -sh $ci_project_dir/.gradle/caches     - set -e     - ./gradlew assembledebug     - mkdir artifacts     - cp mobile/build/outputs/apk/*.apk artifacts/     - cp wear/build/outputs/apk/*.apk artifacts/   cache:     key: $ci_project_name     paths:       - .gradle/wrapper/       - .gradle/caches/       - build/       - mobile/build/       - wear/build/   artifacts:     name: "project_${ci_job_name}_${ci_commit_ref_name}_${ci_commit_sha}"     expire_in: 2 weeks     paths:       - artifacts/ 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -