How can I configure cache for Auto DevOps?


#1

Hello,

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.

Regards,
Mutaz


#2

The docs here describe how to cache dependencies for node modules: https://docs.gitlab.com/ee/ci/caching/#caching-nodejs-dependencies

A similar approach can be taken for for maven.


#3

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: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml

Here is herokuish which exposes a CACHE_PATH: https://github.com/gliderlabs/herokuish#paths

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: https://gitlab.com/help/topics/autodevops/index.md