-
Just declare your downstream jobs (version bump, cd for staging/live etc.) to be dependent on CI job, and configure the job trigger of downstream jobs to fire on desired branches/tags.
-
Unfortunately this does not work. I build my CI job (running on all branches) and a downstream job for staging deployment. The downstream job has the job dependency to CI job and a trigger for branch update on master. After the CI job ran on a feature branch (issue/26) the deployment job nevertheless started.

-
Shortened job definitions:
version: 1 jobs: - name: CI image: '@scripts:builtin:maven:determine-docker-image@' commands: - # does mvn build triggers: - !BranchUpdateTrigger paths: -pom.xml retrieveSource: true cloneCredential: !HttpCredential accessTokenSecret: retrieve-token artifacts: '**' cpuRequirement: 250m memoryRequirement: 128m retryCondition: never maxRetries: 3 retryDelay: 30 caches: - key: maven-cache path: /root/.m2/repository timeout: 3600 - name: Deploy (Staging) image: docker commands: - # does docker build & deploy triggers: - !DependencyFinishedTrigger {} - !BranchUpdateTrigger branches: master retrieveSource: false cloneCredential: !DefaultCredential {} jobDependencies: - jobName: CI requireSuccessful: true artifacts: '**' cpuRequirement: 250m memoryRequirement: 128m retryCondition: never maxRetries: 3 retryDelay: 30 timeout: 3600 -
Remove the trigger "When dependency jobs finished". The "update branches master" trigger will tell Deployment job to trigger upon master update, and if it has any dependencies, it will wait for dependency to finish before firing itself.
-
Thanks, works like a charm. Also needed to wrap my head around not defining the the branch update trigger everywhere even with correct dependencies, because then you'll end up in an andless loop. But everything works now. :)
-
Previous Value Current Value Open
Closed
| Type |
Question
|
| Priority |
Normal
|
| Assignee |
Hi,
I have my CI jobs defined, but I'm trying to simplify the jobs because there is a lot of code duplication. Right now I have the following
So all CI jobs do nearly the same and I'm wondering if it's possible to have something like this:
Right now I don't see any option to set dependencies on other jobs depending on specific branches. Do I miss something? Or do yo maybe think this would be a nice feature? Or do you maybe think a completely other solution would be more suitable?
Best regards, Chris