Skip to content

Instantly share code, notes, and snippets.

@dojci
Last active August 10, 2020 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dojci/dee775544c73139a140931d7c028540e to your computer and use it in GitHub Desktop.
Save dojci/dee775544c73139a140931d7c028540e to your computer and use it in GitHub Desktop.
cf-approval-cache-issue
version: "1.0"
mode: "parallel"
stages:
- "prepare"
- "test"
- "finish"
steps:
loadPipelineVars:
stage: "prepare"
title: "Load pipeline variables"
image: "alpine:latest"
commands:
# Helper pipeline variables
- cf_export PIPELINE_CACHE_PATH=${CF_VOLUME_PATH}/pipeline_cache
preparePipelineCache:
stage: "prepare"
title: "Prepare pipeline cache"
image: "alpine:latest"
commands:
- mkdir -p ${PIPELINE_CACHE_PATH}
- touch ${PIPELINE_CACHE_PATH}/foo
when:
condition:
all:
dependsOnPipelineVars: steps.loadPipelineVars.result == 'success'
showPipelineCacheContentBeforeApproval:
stage: "test"
title: "Show pipeline cache content before approval step"
image: "alpine:latest"
commands:
- ls ${PIPELINE_CACHE_PATH}
when:
condition:
all:
dependsOnPipelineCache: steps.preparePipelineCache.result == 'success'
waitForApproval:
stage: "test"
title: "Cache content exists ?"
type: pending-approval
fail_fast: false
when:
condition:
all:
dependsOnPipelineCacheContent: steps.showPipelineCacheContentBeforeApproval.result == 'success'
dependsOnPipelineCache: steps.preparePipelineCache.result == 'success'
showPipelineCacheContentAfterApproval:
stage: "test"
title: "Show pipeline cache content after approval step"
image: "alpine:latest"
commands:
- ls ${PIPELINE_CACHE_PATH}
when:
condition:
all:
dependsOnExchangeConfigsApproval: steps.waitForApproval.result == 'approved'
dependsOnPipelineCache: steps.preparePipelineCache.result == 'success'
finishPipeline:
stage: "finish"
title: "Finish"
image: "alpine:latest"
commands:
- echo Finished
when:
condition:
all:
dependsOnPipelineStaus: workflow.result == 'terminated' || workflow.result == 'failure' || workflow.result == 'success'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment