Introducing: Clear cache action

November 4, 2021

Introducing: Clear cache action

A CI/CD tool is meant to speed up building, testing and deployment of software, period. This why we've always put so much effort on making our pipelines as fast as possible.

One of the main factors that make Buddy so fast is the way it utilizes its cache. By default, Buddy caches:

  • repository files
  • dependencies
  • Docker layers
  • service data (e.g. databases required for application tests)

However, at times you may not want to use the cache and build everything from scratch instead. Until now, there were two options to achieve that:

  1. Checking the 'Clear cache' flag when running the pipeline
  2. Forcing the pipeline to run without the cache in the pipeline settings

With this week's release you can add a dedicated action to your pipeline that will specify what exactly you want to purge in the pipeline:

  1. Cached Docker layers
  2. Pipeline filesystem (cached dependencies, repository files)
  3. Cache of attached services
  4. Additional cache in build actions used to store files outside pipeline filesystem

Clear cache action overviewClear cache action overview

Use cases

Adding the action to your pipeline opens a new array of possibilities:

  1. The action can be added to any place in the pipeline. Let's assume that the application that you are building requires a configuration file generated with sensitive data fetched from environment variables. Once the config is deployed to the production server, you can purge the filesystem files together with the generated config.

  2. You can define when the action should run using trigger conditions. For example, you can purge the cache only on changes to package-lock.json as we want to build the application afresh together with all dependencies.

In this case, we first create a pipeline like here:

Pipeline configurationPipeline configuration

Then, we go to cache action details and set up the condition for the changeset:

Trigger conditions in the cache actionTrigger conditions in the cache action

Further optimization

Although the use cases above may look a bit user-specific, they can be easily adjusted to any developer workflow thanks to the way Buddy's UI/UX is designed. The tool also offers other methods of pipeline optimization, including multi-condition triggers that let you precisely define what should be run and when, environment variables, crucial for running scripts, deployments, and storing sensitive data, or caching data from services attached to your builds actions, greatly speeding up the execution time.

And if you don't know how to achieve something with Buddy, drop a line to our live-chat and the team will help you set up a pipeline exactly for your use case. 😇


Alexander Kus

Alexander Kus

Customer Success Manager

A story-teller and conversation-lover, Alexander decided to invest his skills to help his friends at Buddy transform the cold language of patch notes into exciting narratives. Also: an avid gamer, hip-hop DJ, Liverpool FC fan, absentminded husband, and the father of two.