Hi, i read about the dynamic condition in steps and try for make a stage like "deploy" but using steps with conditions for things like: build and publish image but not run an infra deploy.
like this.
deploy-to-dev:
- variables:
- name: STEPS_TO_RUN
default: build-publish-deploy
allowed-values:
- build-publish-deploy
- build-publish-only
- deploy-only
- stage:
name: Deploy on DEV
deployment: dev
steps:
- step:
<<: *def-common-variables-step
name: Generate Common Vars
- step:
<<: *def-build-docker-image-step
name: Build Image
condition:
state: STEPS_TO_RUN == "build-publish-deploy" || STEPS_TO_RUN == "build-publish-only"
- step:
<<: *def-publish-docker-image-step
name: Publish Image
condition:
state: STEPS_TO_RUN == "build-publish-deploy" || STEPS_TO_RUN == "build-publish-only"
- step:
<<: *def-eks-deploy-step
name: Deploy EKS CRONJOB
condition:
state: STEPS_TO_RUN == "build-publish-deploy" || STEPS_TO_RUN == "deploy-only"
but when run the pipeline i get an error for: A step within the stage can't contain a condition. The condition must be defined on the stage.
exists a way to make this and not mess with a script in the step?