cirruslabs / cirrus-ci-docs

Documentation for Cirrus CI 📚
https://cirrus-ci.org
MIT License
350 stars 109 forks source link

Support ignoring files in cache upload #262

Closed RDIL closed 5 years ago

RDIL commented 5 years ago

Description

It would be nice if we could ignore uploading new caches if certain files are changed.

Context

In my project, ~/.gradle/caches is always being reuploaded because minecraft/deobfedDeps/compileDummy.jar and minecraft/deobfedDeps/providedDummy.jar are always changed. I can't delete the file as it will fail the build, and constant reuploads slow down the build.

Anything Else

Proposed syntax:

gradle_cache:
  folder: ~/.gradle/caches
  fingerprint_script: cat build.gradle && cat settings.gradle
  populate_script: gradle setupCiWorkspace
  ignore_changes:
    - file1.jar
    - file2.jar
fkorotkov commented 5 years ago

You can add a cleanup script like this:

cache_cleanup_script:
  - rm minecraft/deobfedDeps/compileDummy.jar
  - rm minecraft/deobfedDeps/providedDummy.jar
RDIL commented 5 years ago

Right, but I need them in the cache, or the build fails 😢

fkorotkov commented 5 years ago

But it means you'll get an old version of it. 🤔 Why do they always change?

RDIL commented 5 years ago

No clue, but it has to exist even if it is old.

fkorotkov commented 5 years ago

I'm not convinced that this feature is necessary. Looks like a workaround for an underlying issues. Seems something funky is happening with these jars. First of all, build shouldn't fail on a missing cache. Second, why it's constantly changing?

I'll keep the issue open to see if someone will comment with a better use case for the feature.

Which plugin creates these jars? I think you should raise the issue upstream about the failure. BTW is it happening for an OSS project?

RDIL commented 5 years ago

Yes. https://github.com/MinecraftForge/ForgeGradle I'll ask them.

RDIL commented 5 years ago

I'll try again with the deleting method, as many of the dependencies have updated since then.

RDIL commented 5 years ago

Ooooohhhhh, it looks like it is from an old dependency but was being bumped around because gradle didn't know what to do with it. Thanks!