Skip checkout/save_cache/restore_cache steps?


#1

I have a build in a workflow that basically fits the model of:

jobs:
  build_db:
    - checkout
    - restore_cache # db
    - restore_cache # gems
    - run: # if no existing db cache (indicated by db backup file presence), generate it
    - save_cache # db

Most of the time, this is a noop (code moves faster than database changes - cache will usually be available), so I’m wondering if there’s a good way to omit build steps.

For steps that we control, it’s easy enough to do a little bash:
- run: [ -f filename.txt ] || generate_filename_txt

Is there a similar mechanism to skip steps that are circle built in commands? I’m mostly looking at shaving off the time restoring the gem cache if I know that I won’t need to use it.


Problem: All build steps MUST run without error prior to final success. No skipping or configurably ignoring some errors in CircleCI built-in commands is available
#2

The workaround for this ended up being to combine the DB caching job with the bundle caching job so the overhead was shared. Not the ideal solution, but it’ll work OK for now.


#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.