How can I configure cache for Auto DevOps?


I have configured Auto DevOps on GitLab and everything is working properly, How can I configure the cache for my applications, for example I need to cache maven or node modules for my applications?

Your help will be greatly appreciated.


1 Like

The docs here describe how to cache dependencies for node modules:

A similar approach can be taken for for maven.

Feel like I’m not quite understanding the answer. Been searching Google for ages and still haven’t found a proper answer. Here is the default file used for AutoDevops with Herokuish:

Here is herokuish which exposes a CACHE_PATH:

I’m not seeing any references to any cache configuration in the AutoDevops template file and no references to providing cache to the Herokuish docker container used.

Why isn’t the template AutoDevops using cache by default (our builds are taking around 15 minutes as node_modules takes ages to install)?

Documentation for caching makes it look like it’s as easy as adding some tags in the build but because there’s a Docker container being run with references to a path and the fact it’s not there already makes me think it’s not that simple.

There’s no references to caching whatsoever on the AutoDevops page: