Introducing: Clear cache action

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

Image loading...Clear 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:

Image loading...Pipeline configuration

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

Image loading...Trigger 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.

Warning
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. šŸ˜‡
Jarek Dylewski

Jarek Dylewski

Customer Support

A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.

Nov 4th 2021
Share