I have a pipeline I'm putting together that has three different "deploy" steps, each with its own unique deployment but can be triggered by the same job. Ideally, I would like to find a way to "or" the items inside of the needs section to make the job automatically run after one of those previous jobs completes.
I know I can create a separate job for each job to "run" but I'd like to avoid repeating myself if possible.
Int (Dry Run):
extends: .stageBatchDryRunJob
stage: Deploy Non-Prod
except:
variables:
- $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
variables:
<<: *hubNonVars
kube_cluster_id: HubInt
kube_env: int
environment: int
Int (Rollback):
extends: .stageBatchRollbackJob
stage: Deploy Non-Prod
except:
variables:
- $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
variables:
<<: *hubNonVars
kube_cluster_id: HubInt
kube_env: int
environment: int
I would like to have a single "run" job that requires one of these two above jobs to be completed.
Int (run):
extends: .run-batch
variables:
TOWER_JOB_TEMPLATE: $TOWER_JOB_TEMPLATE_INT
kube_cluster_id: HubInt
kube_env: int
needs: [Int (Dry Run), Int (Rollback)] # can this be "or-ed?" IE needs Int (Dry Run) or Int (Rollback)