Skip to content

Commit

Permalink
don't upload cache if it was fetched initially
Browse files Browse the repository at this point in the history
  • Loading branch information
chmouel committed Apr 30, 2024
1 parent 9157678 commit 48f14d6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tekton/cache-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ spec:
Whether to use insecure mode for fetching the cache
type: string
default: "false"
results: # Any result to "publish" ?
- name: fetched
description: |
Whether a cache was fetched or not (true/false). This step won't fail if it didn't manage to fetch cache. This results allows the next step to act whether something was fetched or not.
env:
- name: PARAM_TARGET
value: $(params.target)
Expand All @@ -46,11 +42,17 @@ spec:
value: $(params.workingdir)
- name: PARAM_INSECURE
value: $(params.insecure)
- name: CACHE_FETCHED
value: $(steps.fetch-cache.results.fetched)
# FIXME: use a released version once something is released :)
image: ghcr.io/openshift-pipelines/tekton-caches/cache:latest
args: ["$(params.patterns[*])"]
script: |
#!/bin/sh
#!/usr/bin/env sh
if [[ ${CACHE_FETCHED} == "true" ]]; then
echo "no need to upload cache"
exit 0
fi
PATTERN_FLAGS=""
echo "Patterns: $*"
Expand Down

0 comments on commit 48f14d6

Please sign in to comment.