Conditional execution
runIf
Welder offers conditional execution of tasks. For example, you may want to skip certain tasks when skip-tests mode
is enabled:
Welder uses expr library to evaluate expressions for runIf, so it supports all logical
operators implemented in this library.
Conditional profiles
The same applies to if directive for a profile activation:
profiles:
pipelines:
activation:
pipelines: true
build:
env:
PIPELINES_JWT_TOKEN: "${env:PIPELINES_JWT_TOKEN}"
TESTCONTAINERS_RYUK_DISABLED: "true"
TESTCONTAINERS_HOST_OVERRIDE: "${env:BITBUCKET_DOCKER_HOST_INTERNAL}"
local:
activation:
if: "!${mode:bamboo} && !${mode:pipelines}"
build:
env:
TOKEN: "${task:token.trim}" # generate token for local testing against backend
# ...
tasks:
token:
runOn: host
script:
- generate-token --aud backend -o jwt