Skip to content

Commit

Permalink
fix path
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed Nov 28, 2020
1 parent a3a6b12 commit e10c79c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ def genericCache(name, action, mounts, cache_key):
}
return step

def genericCachePurge(name, cache_key):
def genericCachePurge(ctx, name, cache_key):
return {
'kind': 'pipeline',
'type': 'docker',
Expand All @@ -1629,13 +1629,14 @@ def genericCachePurge(name, cache_key):
{
'name': 'purge-cache',
'image': 'minio/mc',
'failure': 'ignore',
'environment': {
'MC_HOST_cache': {
'from_secret': 'cache_s3_connection_url'
}
},
'commands': [
'mc rm --recursive --force %s' % (cache_key),
'mc rm --recursive --force %s/%s' % (ctx.repo.name, cache_key),
]
},
],
Expand All @@ -1658,7 +1659,7 @@ def genericBuildArtifactCache(ctx, name, action, path):
if action == "rebuild" or action == "restore":
return genericCache(name, action, [path], cache_key)
if action == "purge":
return genericCachePurge(name, cache_key)
return genericCachePurge(ctx, name, cache_key)
return []

def restoreBuildArtifactCache(ctx, name, path):
Expand Down

0 comments on commit e10c79c

Please sign in to comment.