You will need about one minute to read this article.
This article addresses caching on Codeship Basic. There is a separate guide for caching on Codeship Pro.
On all Codeship Basic projects, we automatically cache the dependency directories for several popular tools to speed up future builds.
This means that all packages saved in these directories at the end of a build will be automatically loaded on the build machine for future builds.
Any packages, up to 500mb, in the following directories at the end of your build will be automatically cached:
$HOME/.ivy2
$HOME/.m2/repository
$HOME/cache
$HOME/cache/bundler
$HOME/cache/pip
$HOME/cache/yarn
$HOME/clone/node_modules
We automatically configure bundler
to write to $HOME/cache/bundler
, pip
to write to $HOME/cache/pip
and yarn
to write to $HOME/cache/yarn
.
You can manually clear the dependency cache in several different ways:
cs clear-cache
command at the start of your setup commands to clear everything under $HOME/cache
.rm -rf node_modules
.If you want to cache items in your build that are not already handled in the automatic configurations above you can also manually cache items. If the tool you are using provides a way to set a cache location, perhaps with an environment variable, you can point it to the $HOME/cache
directory.
Otherwise you can manually copy items to $HOME/cache
at the end of the build and then at the start of the build you can either copy them back out of the cache or create a symlink to the cached location.
Contact our support team or post on Stack Overflow using the tag #codeship
. Did you check the status page and changelog?
There are also several code examples and sample projects available for you to get started with.
Does this article need improvement? If so, please send feedback or submit a pull request!