2

Sometimes when a concourse pipeline is getting build, it tries to use the previous version of resource, not the latest one. I could confirm this because the resource hash don't match. Please let me know a solution to flush the resource hash.

7ochem
  • 2,183
  • 1
  • 34
  • 42
shoan
  • 1,303
  • 15
  • 22

5 Answers5

4

Concourse v7.4.0 (released August 2021) adds the command

fly clear-resource-cache -r <pipeline>/<resource>

which will do what you are looking for.

See:

marco.m
  • 4,573
  • 2
  • 26
  • 41
1

The only way to flush the resource cache is to restart all the workers, as this will clear your ephemeral disks.

Josh Zarrabi
  • 1,054
  • 7
  • 15
0

The fly clear-resource-cache -r <pipeline>/<resource> command doesn't work for older versions.

To achieve similar results, you can use

fly -t ci clear-task-cache -j <pipeline>/<resource> -s <step-name>

Check the help command for more info:

Usage:
  fly [OPTIONS] clear-task-cache [clear-task-cache-OPTIONS]

Application Options:
  -t, --target=              Concourse target name
  -v, --version              Print the version of Fly and exit
      --verbose              Print API requests and responses
      --print-table-headers  Print table headers even for redirected output

Help Options:
  -h, --help                 Show this help message

[clear-task-cache command options]
      -j, --job=             Job to clear cache from
      -s, --step=            Step name to clear cache from
      -c, --cache-path=      Cache directory to clear out
      -n, --non-interactive  Destroy the task cache(s) without confirmation
Artan M.
  • 817
  • 1
  • 11
  • 16
0

For resources:

fly -t example clear-resource-cache -r my-pipeline/my-resource

Corresponding documenation link.

For tasks: I've tested this on 7.9.1 (fairly recently as of this post - about 3 weeks ago).

fly -t demo clear-task-cache --job java-api-pipeline/compile-app-task --step task1

To see this in action see the online course " Getting Started with Concourse CI" on Pluralsight, Module 4: Composing and Managing Pipelines, Clip 4: Demo: Running and Managing Pipelines.

Corresponding documentation link.

George Smith
  • 438
  • 4
  • 8
-1

As of the time of this writing 2023-06-21, the command to clear the cache requires a target, so:

fly -t <target> clear-resource-cache -r <pipeline>/<resource>

Sample:

fly -t demo destroy-pipeline -p java-api-pipeline 
George Smith
  • 438
  • 4
  • 8